@0x/contracts-exchange: Start work on isolated fill order tests.

This commit is contained in:
Lawrence Forman
2019-07-27 22:47:48 -04:00
parent 2f91a12f19
commit 72c7157138
9 changed files with 169 additions and 7 deletions

View File

@@ -0,0 +1,49 @@
import {
blockchainTests,
constants,
expect,
FillResults,
txDefaults,
} from '@0x/contracts-test-utils';
import { Order, SignedOrder } from '@0x/types';
import { BigNumber } from '@0x/utils';
import { artifacts, TestExchangeInternalsContract, TestExchangeMathContract } from '../src';
const emptyOrder: Order = {
senderAddress: constants.NULL_ADDRESS,
makerAddress: constants.NULL_ADDRESS,
takerAddress: constants.NULL_ADDRESS,
makerFee: new BigNumber(0),
takerFee: new BigNumber(0),
makerAssetAmount: new BigNumber(0),
takerAssetAmount: new BigNumber(0),
makerAssetData: '0x',
takerAssetData: '0x',
makerFeeAssetData: '0x',
takerFeeAssetData: '0x',
salt: new BigNumber(0),
feeRecipientAddress: constants.NULL_ADDRESS,
expirationTimeSeconds: new BigNumber(0),
domain: {
verifyingContractAddress: constants.NULL_ADDRESS,
chainId: 0, // To be filled in later.
},
};
const emptySignedOrder: SignedOrder = {
...emptyOrder,
signature: '',
};
blockchainTests.only('Isolated fillOrder()', () => {
it('foo', async () => {
expect('foo').to.equal('foo');
});
blockchainTests.resets('inner', () => {
it('bar', async () => {
return expect(Promise.resolve(true)).to.eventually.be.ok;
});
});
require('./nested');
});

View File

@@ -5,12 +5,11 @@ import {
ERC721Wrapper,
MultiAssetProxyContract,
} from '@0x/contracts-asset-proxy';
import { chaiSetup, constants, FillResults, orderUtils, signingUtils } from '@0x/contracts-test-utils';
import { constants, expect, FillResults, orderUtils, signingUtils } from '@0x/contracts-test-utils';
import { BalanceAndProxyAllowanceLazyStore, ExchangeRevertErrors, orderHashUtils } from '@0x/order-utils';
import { Order, SignatureType, SignedOrder } from '@0x/types';
import { BigNumber, errorUtils, providerUtils, RevertError, StringRevertError } from '@0x/utils';
import { SupportedProvider, Web3Wrapper } from '@0x/web3-wrapper';
import * as chai from 'chai';
import { LogWithDecodedArgs, TxData } from 'ethereum-types';
import * as _ from 'lodash';
import 'make-promises-safe';
@@ -36,9 +35,6 @@ import { FillOrderError, FillOrderSimulator } from './fill_order_simulator';
import { OrderFactoryFromScenario } from './order_factory_from_scenario';
import { SimpleAssetBalanceAndProxyAllowanceFetcher } from './simple_asset_balance_and_proxy_allowance_fetcher';
chaiSetup.configure();
const expect = chai.expect;
const EMPTY_FILL_RESULTS = {
takerAssetFilledAmount: constants.ZERO_AMOUNT,
makerAssetFilledAmount: constants.ZERO_AMOUNT,