Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove warnings #896

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions src/pegin/store/FlyoverPegin/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,10 @@ export const actions: ActionTree<FlyoverPeginState, RootState> = {
result = constants.FlyoverCallResult.SUCCESS;
resolve(commit(constants.FLYOVER_PEGIN_SET_PROVIDERS, providers));
} catch (e) {
reject();
reject(new Error('Error getting liquidity providers'));
} finally {
try {
await ApiService.registerFlyoverCall({ ...flyoverCallPayload, result } as FlyoverCall);
} catch (e) {
console.error(`Error registering flyover ${flyoverCallPayload.functionType} call: ${e}`);
}
ApiService.registerFlyoverCall({ ...flyoverCallPayload, result } as FlyoverCall)
.catch(() => null);
}
})();
}),
Expand Down Expand Up @@ -84,13 +81,10 @@ export const actions: ActionTree<FlyoverPeginState, RootState> = {
result = constants.FlyoverCallResult.SUCCESS;
resolve(commit(constants.FLYOVER_PEGIN_SET_QUOTES, quotesByProvider));
} catch (e) {
reject(e);
reject(new Error('Error getting quotes'));
} finally {
try {
await ApiService.registerFlyoverCall({ ...flyoverCallPayload, result } as FlyoverCall);
} catch (e) {
console.error(`Error registering flyover ${flyoverCallPayload.functionType} call: ${e}`);
}
ApiService.registerFlyoverCall({ ...flyoverCallPayload, result } as FlyoverCall)
.catch(() => null);
}
})();
}),
Expand Down
18 changes: 6 additions & 12 deletions src/pegout/store/FlyoverPegout/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,10 @@ export const actions: ActionTree<FlyoverPegoutState, RootState> = {
result = constants.FlyoverCallResult.SUCCESS;
resolve(commit(constants.FLYOVER_PEGOUT_SET_PROVIDERS, providers));
} catch (e) {
reject();
reject(new Error('Error getting providers'));
} finally {
try {
await ApiService.registerFlyoverCall({ ...flyoverCallPayload, result } as FlyoverCall);
} catch (e) {
console.error(`Error registering flyover ${flyoverCallPayload.functionType} call: ${e}`);
}
ApiService.registerFlyoverCall({ ...flyoverCallPayload, result } as FlyoverCall)
.catch(() => null);
}
})();
}),
Expand Down Expand Up @@ -92,13 +89,10 @@ export const actions: ActionTree<FlyoverPegoutState, RootState> = {
commit(constants.FLYOVER_PEGOUT_SET_QUOTES, quotesByProvider);
resolve();
} catch (e) {
reject();
reject(new Error('Error getting quotes'));
} finally {
try {
await ApiService.registerFlyoverCall({ ...flyoverCallPayload, result } as FlyoverCall);
} catch (e) {
console.error(`Error registering flyover ${flyoverCallPayload.functionType} call: ${e}`);
}
ApiService.registerFlyoverCall({ ...flyoverCallPayload, result } as FlyoverCall)
.catch(() => null);
}
})();
});
Expand Down
6 changes: 4 additions & 2 deletions tests/unit/common/PeginQuote.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,14 @@ describe('PeginQuote', () => {
it('should calculate totalQuoteFee correctly', () => {
const btcNetworkFee = new SatoshiBig(100000000, 'satoshi');
const expectedTotalQuoteFee = peginQuote.providerFee.plus(btcNetworkFee);
expect(peginQuote.getTotalQuoteFee(btcNetworkFee).toString()).toEqual(expectedTotalQuoteFee.toString());
expect(peginQuote.getTotalQuoteFee(btcNetworkFee).toString())
.toEqual(expectedTotalQuoteFee.toString());
});

it('should calculate totalTxAmount correctly', () => {
const btcNetworkFee = new SatoshiBig(100000000, 'satoshi');
const expectedTotalTxAmount = peginQuote.valueToTransfer.plus(btcNetworkFee);
expect(peginQuote.getTotalTxAmount(btcNetworkFee).toString()).toEqual(expectedTotalTxAmount.toString());
expect(peginQuote.getTotalTxAmount(btcNetworkFee).toString())
.toEqual(expectedTotalTxAmount.toString());
});
});
Loading