Skip to content

Commit

Permalink
chore: add return types
Browse files Browse the repository at this point in the history
  • Loading branch information
james-a-morris committed Sep 5, 2023
1 parent f566c24 commit f4a6500
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
9 changes: 7 additions & 2 deletions test/mocks/MockAdapterManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ export class MockAdapterManager extends AdapterManager {
} = {};

public mockedOutstandingCrossChainTransfers: { [chainId: number]: OutstandingTransfers } = {};
async sendTokenCrossChain(address: string, chainId: number, l1Token: string, amount: BigNumber) {
async sendTokenCrossChain(
_address: string,
chainId: number,
l1Token: string,
amount: BigNumber
): Promise<TransactionResponse> {
if (!this.tokensSentCrossChain[chainId]) {
this.tokensSentCrossChain[chainId] = {};
}
Expand All @@ -35,7 +40,7 @@ export class MockAdapterManager extends AdapterManager {
return this.mockedOutstandingCrossChainTransfers[chainId];
}

setMockedOutstandingCrossChainTransfers(chainId: number, address: string, l1Token: string, amount: BigNumber) {
setMockedOutstandingCrossChainTransfers(chainId: number, address: string, l1Token: string, amount: BigNumber): void {
if (!this.mockedOutstandingCrossChainTransfers[chainId]) {
this.mockedOutstandingCrossChainTransfers[chainId] = {};
}
Expand Down
8 changes: 4 additions & 4 deletions test/mocks/MockBundleDataClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ export class MockBundleDataClient extends BundleDataClient {
private pendingBundleRefunds: FillsToRefund = {};
private nextBundleRefunds: FillsToRefund = {};

async getPendingRefundsFromValidBundles() {
async getPendingRefundsFromValidBundles(): Promise<FillsToRefund[]> {
return [this.pendingBundleRefunds];
}

async getNextBundleRefunds() {
async getNextBundleRefunds(): Promise<FillsToRefund> {
return this.nextBundleRefunds;
}

setReturnedPendingBundleRefunds(refunds: FillsToRefund) {
setReturnedPendingBundleRefunds(refunds: FillsToRefund): void {
this.pendingBundleRefunds = refunds;
}

setReturnedNextBundleRefunds(refunds: FillsToRefund) {
setReturnedNextBundleRefunds(refunds: FillsToRefund): void {
this.nextBundleRefunds = refunds;
}
}
2 changes: 1 addition & 1 deletion test/mocks/MockInventoryClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export class MockInventoryClient extends InventoryClient {
super(null, null, null, null, null, null, null, null, null);
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async determineRefundChainId(_deposit: Deposit) {
async determineRefundChainId(_deposit: Deposit): Promise<number> {
return 1;
}
}
10 changes: 5 additions & 5 deletions test/mocks/MockTokenClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ export class MockTokenClient extends TokenClient {
[chainId: number]: { [token: string]: { deposits: number[]; totalRequirement: BigNumber } };
} = {};

setTokenData(chainId: number, token: string, balance: BigNumber, allowance: BigNumber = toBN(0)) {
setTokenData(chainId: number, token: string, balance: BigNumber, allowance: BigNumber = toBN(0)): void {
if (!this.tokenData[chainId]) {
this.tokenData[chainId] = {};
}
this.tokenData[chainId][token] = { balance, allowance };
}
setTokenShortFallData(chainId: number, token: string, deposits: number[], totalRequirement: BigNumber) {
setTokenShortFallData(chainId: number, token: string, deposits: number[], totalRequirement: BigNumber): void {
if (!this.tokenShortfall[chainId]) {
this.tokenShortfall[chainId] = {};
}
this.tokenShortfall[chainId][token] = { deposits, totalRequirement };
}

getBalance(chainId: number, token: string) {
getBalance(chainId: number, token: string): BigNumber {
if (!this.tokenData[chainId]) {
return toBN(0);
}
Expand All @@ -31,7 +31,7 @@ export class MockTokenClient extends TokenClient {
return this.tokenData[chainId][token].balance;
}

getTokensNeededToCoverShortfall(chainId: number, token: string) {
getTokensNeededToCoverShortfall(chainId: number, token: string): BigNumber {
if (!this.tokenShortfall[chainId]) {
return toBN(0);
}
Expand All @@ -41,7 +41,7 @@ export class MockTokenClient extends TokenClient {
return this.tokenShortfall[chainId][token].totalRequirement;
}

decrementLocalBalance(chainId: number, token: string, amount: BigNumber) {
decrementLocalBalance(chainId: number, token: string, amount: BigNumber): void {
if (!this.tokenData[chainId]) {
this.tokenData[chainId] = {};
}
Expand Down

0 comments on commit f4a6500

Please sign in to comment.