diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-08-23 05:58:03 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-08-23 06:39:03 +0800 |
commit | b0b3f9e339cc470860f8c1080ab6dad145d70624 (patch) | |
tree | e6fa0def5441fed853a700deead0ac4a480dd045 /packages/forwarder-helper/src | |
parent | a5c7ddcff54fcb9e88adfda15167836b00db877d (diff) | |
download | dexon-sol-tools-b0b3f9e339cc470860f8c1080ab6dad145d70624.tar dexon-sol-tools-b0b3f9e339cc470860f8c1080ab6dad145d70624.tar.gz dexon-sol-tools-b0b3f9e339cc470860f8c1080ab6dad145d70624.tar.bz2 dexon-sol-tools-b0b3f9e339cc470860f8c1080ab6dad145d70624.tar.lz dexon-sol-tools-b0b3f9e339cc470860f8c1080ab6dad145d70624.tar.xz dexon-sol-tools-b0b3f9e339cc470860f8c1080ab6dad145d70624.tar.zst dexon-sol-tools-b0b3f9e339cc470860f8c1080ab6dad145d70624.zip |
Add assertions to factory
Diffstat (limited to 'packages/forwarder-helper/src')
-rw-r--r-- | packages/forwarder-helper/src/forwarder_helper_factory.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/forwarder-helper/src/forwarder_helper_factory.ts b/packages/forwarder-helper/src/forwarder_helper_factory.ts index 0fb02e3a6..95f11f555 100644 --- a/packages/forwarder-helper/src/forwarder_helper_factory.ts +++ b/packages/forwarder-helper/src/forwarder_helper_factory.ts @@ -1,3 +1,5 @@ +import { assert } from '@0xproject/assert'; +import { schemas } from '@0xproject/json-schemas'; import { SignedOrder } from '@0xproject/types'; import { ForwarderHelperImpl, ForwarderHelperImplConfig } from './forwarder_helper_impl'; @@ -7,10 +9,12 @@ export const forwarderHelperFactory = { /** * Given an array of orders and an array of feeOrders * @param orders An array of objects conforming to SignedOrder. Each order should specify the same makerAssetData and takerAssetData - * @param orders An array of objects conforming to SignedOrder. Each order should specify ZRX as makerAssetData WETH as takerAssetData + * @param feeOrders An array of objects conforming to SignedOrder. Each order should specify ZRX as makerAssetData WETH as takerAssetData * @return A ForwarderHelper, see type for definition */ getForwarderHelperForOrders(orders: SignedOrder[], feeOrders: SignedOrder[] = []): ForwarderHelper { + assert.doesConformToSchema('orders', orders, schemas.signedOrdersSchema); + assert.doesConformToSchema('feeOrders', orders, schemas.signedOrdersSchema); const config: ForwarderHelperImplConfig = { orders, feeOrders, |