mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Add validation for the fee
property from the /trades
API response (#10836)
This commit is contained in:
parent
501829e5ca
commit
135f0bb4f0
@ -101,6 +101,7 @@ export const MOCK_TRADE_RESPONSE_1 = [
|
|||||||
sourceAmount: '10000000000000000',
|
sourceAmount: '10000000000000000',
|
||||||
destinationAmount: '2248687',
|
destinationAmount: '2248687',
|
||||||
error: null,
|
error: null,
|
||||||
|
fee: 0.875,
|
||||||
sourceToken: TOKENS[0].address,
|
sourceToken: TOKENS[0].address,
|
||||||
destinationToken: TOKENS[1].address,
|
destinationToken: TOKENS[1].address,
|
||||||
fetchTime: 553,
|
fetchTime: 553,
|
||||||
|
@ -131,6 +131,10 @@ const QUOTE_VALIDATORS = [
|
|||||||
type: 'number|undefined',
|
type: 'number|undefined',
|
||||||
validator: (gasEstimate) => gasEstimate === undefined || gasEstimate > 0,
|
validator: (gasEstimate) => gasEstimate === undefined || gasEstimate > 0,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
property: 'fee',
|
||||||
|
type: 'number',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const TOKEN_VALIDATORS = [
|
const TOKEN_VALIDATORS = [
|
||||||
|
@ -64,6 +64,7 @@ describe('Swaps Util', function () {
|
|||||||
sourceAmount: '10000000000000000',
|
sourceAmount: '10000000000000000',
|
||||||
destinationAmount: '2248687',
|
destinationAmount: '2248687',
|
||||||
error: null,
|
error: null,
|
||||||
|
fee: 0.875,
|
||||||
sourceToken: TOKENS[0].address,
|
sourceToken: TOKENS[0].address,
|
||||||
destinationToken: TOKENS[1].address,
|
destinationToken: TOKENS[1].address,
|
||||||
fetchTime: 553,
|
fetchTime: 553,
|
||||||
|
Loading…
Reference in New Issue
Block a user