Add validation for the `fee` property from the `/trades` API response (#10836)

feature/default_network_editable
Daniel 4 years ago committed by GitHub
parent 501829e5ca
commit 135f0bb4f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      ui/app/pages/swaps/swaps-util-test-constants.js
  2. 4
      ui/app/pages/swaps/swaps.util.js
  3. 1
      ui/app/pages/swaps/swaps.util.test.js

@ -101,6 +101,7 @@ export const MOCK_TRADE_RESPONSE_1 = [
sourceAmount: '10000000000000000',
destinationAmount: '2248687',
error: null,
fee: 0.875,
sourceToken: TOKENS[0].address,
destinationToken: TOKENS[1].address,
fetchTime: 553,

@ -131,6 +131,10 @@ const QUOTE_VALIDATORS = [
type: 'number|undefined',
validator: (gasEstimate) => gasEstimate === undefined || gasEstimate > 0,
},
{
property: 'fee',
type: 'number',
},
];
const TOKEN_VALIDATORS = [

@ -64,6 +64,7 @@ describe('Swaps Util', function () {
sourceAmount: '10000000000000000',
destinationAmount: '2248687',
error: null,
fee: 0.875,
sourceToken: TOKENS[0].address,
destinationToken: TOKENS[1].address,
fetchTime: 553,

Loading…
Cancel
Save