Skip to content

Commit

Permalink
Remove block number from type
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholaspai committed Feb 20, 2024
1 parent 2fbccaf commit 1290e7e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/clients/HubPoolClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ type L1TokensToDestinationTokens = {
// Temporary type for v2 -> v3 transition. @todo: Remove.
type V2PartialDepositWithBlock = Pick<
V2DepositWithBlock,
"originChainId" | "originToken" | "amount" | "quoteTimestamp" | "blockNumber"
"originChainId" | "originToken" | "amount" | "quoteTimestamp"
>;

// Temporary type for v2 -> v3 transition. @todo: Remove.
type V3PartialDepositWithBlock = Pick<
V3DepositWithBlock,
"originChainId" | "inputToken" | "inputAmount" | "quoteTimestamp" | "blockNumber"
"originChainId" | "inputToken" | "inputAmount" | "quoteTimestamp"
>;

export type LpFeeRequest = (V2PartialDepositWithBlock | V3PartialDepositWithBlock) & { paymentChainId?: number };
Expand Down
2 changes: 0 additions & 2 deletions src/clients/SpokePoolClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
isV2SpeedUp,
isV3SpeedUp,
toBN,
assert,
} from "../utils";
import {
paginatedEventQuery,
Expand Down Expand Up @@ -989,7 +988,6 @@ export class SpokePoolClient extends BaseAbstractClient {
originChainId: this.chainId,
paymentChainId: _paymentChainId,
quoteTimestamp: event.args.quoteTimestamp,
blockNumber: event.blockNumber,
};
});

Expand Down
9 changes: 5 additions & 4 deletions src/clients/mocks/MockHubPoolClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,15 @@ export class MockHubPoolClient extends HubPoolClient {

async computeRealizedLpFeePct(deposit: LpFeeRequest): Promise<RealizedLpFee> {
const { realizedLpFeePct, realizedLpFeePctOverride } = this;
const { blockNumber: quoteBlock } = deposit;
return realizedLpFeePctOverride ? { realizedLpFeePct, quoteBlock } : await super.computeRealizedLpFeePct(deposit);
return realizedLpFeePctOverride
? { realizedLpFeePct, quoteBlock: 0 }
: await super.computeRealizedLpFeePct(deposit);
}
async batchComputeRealizedLpFeePct(_deposits: LpFeeRequest[]): Promise<RealizedLpFee[]> {
const { realizedLpFeePct, realizedLpFeePctOverride } = this;
return realizedLpFeePctOverride
? _deposits.map(({ blockNumber: quoteBlock }) => {
return { realizedLpFeePct, quoteBlock };
? _deposits.map(() => {
return { realizedLpFeePct, quoteBlock: 0 };
})
: await super.batchComputeRealizedLpFeePct(_deposits);
}
Expand Down

0 comments on commit 1290e7e

Please sign in to comment.