diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-07-19 07:21:24 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-07-31 04:58:19 +0800 |
commit | a7238d0fdb302d7062f3f63c3119910286f992c5 (patch) | |
tree | 6fbfb256537f0727dcb4dfe9fcce24434b537e26 /packages/contract-wrappers/test | |
parent | 02eb575813564b0586a038cc1229a166cb402146 (diff) | |
download | dexon-sol-tools-a7238d0fdb302d7062f3f63c3119910286f992c5.tar.gz dexon-sol-tools-a7238d0fdb302d7062f3f63c3119910286f992c5.tar.zst dexon-sol-tools-a7238d0fdb302d7062f3f63c3119910286f992c5.zip |
Implement initial forwarder wrapper
Diffstat (limited to 'packages/contract-wrappers/test')
-rw-r--r-- | packages/contract-wrappers/test/forwarder_wrapper_test.ts | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/packages/contract-wrappers/test/forwarder_wrapper_test.ts b/packages/contract-wrappers/test/forwarder_wrapper_test.ts new file mode 100644 index 000000000..61a21a0d7 --- /dev/null +++ b/packages/contract-wrappers/test/forwarder_wrapper_test.ts @@ -0,0 +1,57 @@ +import { BlockchainLifecycle, callbackErrorReporter } from '@0xproject/dev-utils'; +import { FillScenarios } from '@0xproject/fill-scenarios'; +import { assetDataUtils, orderHashUtils } from '@0xproject/order-utils'; +import { DoneCallback, SignedOrder } from '@0xproject/types'; +import { BigNumber } from '@0xproject/utils'; +import * as chai from 'chai'; +import { BlockParamLiteral } from 'ethereum-types'; +import 'mocha'; + +import { + ContractWrappers, + DecodedLogEvent, + ExchangeCancelEventArgs, + ExchangeEvents, + ExchangeFillEventArgs, + OrderStatus, +} from '../src'; + +import { chaiSetup } from './utils/chai_setup'; +import { constants } from './utils/constants'; +import { tokenUtils } from './utils/token_utils'; +import { provider, web3Wrapper } from './utils/web3_wrapper'; + +chaiSetup.configure(); +const expect = chai.expect; +const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper); + +describe('ForwarderWrapper', () => { + let contractWrappers: ContractWrappers; + let forwarderContractAddress: string; + let userAddresses: string[]; + const config = { + networkId: constants.TESTRPC_NETWORK_ID, + blockPollingIntervalMs: 0, + }; + before(async () => { + await blockchainLifecycle.startAsync(); + contractWrappers = new ContractWrappers(provider, config); + forwarderContractAddress = contractWrappers.exchange.getContractAddress(); + userAddresses = await web3Wrapper.getAvailableAddressesAsync(); + }); + after(async () => { + await blockchainLifecycle.revertAsync(); + }); + beforeEach(async () => { + await blockchainLifecycle.startAsync(); + }); + afterEach(async () => { + await blockchainLifecycle.revertAsync(); + }); + // describe('#fillOrderAsync', () => { + // it('should fill a valid order', async () => { + // // txHash = await contractWrappers.exchange.fillOrderAsync(signedOrder, takerTokenFillAmount, takerAddress); + // // await web3Wrapper.awaitTransactionSuccessAsync(txHash, constants.AWAIT_TRANSACTION_MINED_MS); + // }); + // }); +}); |