diff options
Diffstat (limited to 'packages/0x.js/test/utils')
-rw-r--r-- | packages/0x.js/test/utils/fill_scenarios.ts | 4 | ||||
-rw-r--r-- | packages/0x.js/test/utils/order_factory.ts | 46 | ||||
-rw-r--r-- | packages/0x.js/test/utils/web3_wrapper.ts | 3 |
3 files changed, 2 insertions, 51 deletions
diff --git a/packages/0x.js/test/utils/fill_scenarios.ts b/packages/0x.js/test/utils/fill_scenarios.ts index 7d0e8c501..5a82a56d2 100644 --- a/packages/0x.js/test/utils/fill_scenarios.ts +++ b/packages/0x.js/test/utils/fill_scenarios.ts @@ -1,10 +1,10 @@ +import { orderFactory } from '@0xproject/order-utils'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import { SignedOrder, Token, ZeroEx } from '../../src'; import { artifacts } from '../../src/artifacts'; import { DummyTokenContract } from '../../src/contract_wrappers/generated/dummy_token'; -import { orderFactory } from '../utils/order_factory'; import { constants } from './constants'; @@ -164,7 +164,7 @@ export class FillScenarios { ]); const signedOrder = await orderFactory.createSignedOrderAsync( - this._zeroEx, + this._zeroEx.getProvider(), makerAddress, takerAddress, makerFee, diff --git a/packages/0x.js/test/utils/order_factory.ts b/packages/0x.js/test/utils/order_factory.ts deleted file mode 100644 index 08f2081a4..000000000 --- a/packages/0x.js/test/utils/order_factory.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { BigNumber } from '@0xproject/utils'; -import * as _ from 'lodash'; - -import { SignedOrder, ZeroEx } from '../../src'; - -const SHOULD_ADD_PERSONAL_MESSAGE_PREFIX = false; - -export const orderFactory = { - async createSignedOrderAsync( - zeroEx: ZeroEx, - maker: string, - taker: string, - makerFee: BigNumber, - takerFee: BigNumber, - makerTokenAmount: BigNumber, - makerTokenAddress: string, - takerTokenAmount: BigNumber, - takerTokenAddress: string, - exchangeContractAddress: string, - feeRecipient: string, - expirationUnixTimestampSecIfExists?: BigNumber, - ): Promise<SignedOrder> { - const defaultExpirationUnixTimestampSec = new BigNumber(2524604400); // Close to infinite - const expirationUnixTimestampSec = _.isUndefined(expirationUnixTimestampSecIfExists) - ? defaultExpirationUnixTimestampSec - : expirationUnixTimestampSecIfExists; - const order = { - maker, - taker, - makerFee, - takerFee, - makerTokenAmount, - takerTokenAmount, - makerTokenAddress, - takerTokenAddress, - salt: ZeroEx.generatePseudoRandomSalt(), - exchangeContractAddress, - feeRecipient, - expirationUnixTimestampSec, - }; - const orderHash = ZeroEx.getOrderHashHex(order); - const ecSignature = await zeroEx.signOrderHashAsync(orderHash, maker, SHOULD_ADD_PERSONAL_MESSAGE_PREFIX); - const signedOrder: SignedOrder = _.assign(order, { ecSignature }); - return signedOrder; - }, -}; diff --git a/packages/0x.js/test/utils/web3_wrapper.ts b/packages/0x.js/test/utils/web3_wrapper.ts index b7b3f0b7f..b0ccfa546 100644 --- a/packages/0x.js/test/utils/web3_wrapper.ts +++ b/packages/0x.js/test/utils/web3_wrapper.ts @@ -1,9 +1,6 @@ import { devConstants, web3Factory } from '@0xproject/dev-utils'; import { Provider } from '@0xproject/types'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; -import * as Web3 from 'web3'; - -import { constants } from './constants'; const web3 = web3Factory.create({ shouldUseInProcessGanache: true }); const provider: Provider = web3.currentProvider; |