Merge branch 'development' into feature/instant/fixed-orders-in-render-method

* development:
  Has Sufficient Funds/Balance -> Has Sufficient ETH
  When transaction too low, treat as validation error. also modify callback: errorMessage could be AssetBuyError as well
  onPendingValidation -> onValidationPending
  linting
  Simpler way of validaitng has enough eth
  questionmark syntax instead of '| undefined'
  Validate enough ETH when user clicks buy
  acccount for no address
  move funct into util
  move imports
  yarn.lock changes
  feat(instant): Show message if user doesn't have enough ETH
  ethDecimals -> ETH_DECIMALS
This commit is contained in:
Brandon Millman
2018-10-29 10:26:27 -07:00
11 changed files with 79 additions and 69 deletions

View File

@@ -1,15 +1,15 @@
import { BigNumber } from '@0x/utils';
import { Web3Wrapper } from '@0x/web3-wrapper';
import { ethDecimals } from '../../src/constants';
import { ETH_DECIMALS } from '../../src/constants';
import { format } from '../../src/util/format';
const BIG_NUMBER_ONE = new BigNumber(1);
const BIG_NUMBER_DECIMAL = new BigNumber(0.432414);
const BIG_NUMBER_IRRATIONAL = new BigNumber(5.3014059295032);
const ONE_ETH_IN_BASE_UNITS = Web3Wrapper.toBaseUnitAmount(BIG_NUMBER_ONE, ethDecimals);
const DECIMAL_ETH_IN_BASE_UNITS = Web3Wrapper.toBaseUnitAmount(BIG_NUMBER_DECIMAL, ethDecimals);
const IRRATIONAL_ETH_IN_BASE_UNITS = Web3Wrapper.toBaseUnitAmount(BIG_NUMBER_IRRATIONAL, ethDecimals);
const ONE_ETH_IN_BASE_UNITS = Web3Wrapper.toBaseUnitAmount(BIG_NUMBER_ONE, ETH_DECIMALS);
const DECIMAL_ETH_IN_BASE_UNITS = Web3Wrapper.toBaseUnitAmount(BIG_NUMBER_DECIMAL, ETH_DECIMALS);
const IRRATIONAL_ETH_IN_BASE_UNITS = Web3Wrapper.toBaseUnitAmount(BIG_NUMBER_IRRATIONAL, ETH_DECIMALS);
const BIG_NUMBER_FAKE_ETH_USD_PRICE = new BigNumber(2.534);
describe('format', () => {