aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contract-wrappers/src/contract_wrappers
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-11-10 07:14:48 +0800
committerFabio Berger <me@fabioberger.com>2018-11-10 07:14:48 +0800
commit1f0ac47bd97b88071a6380a728cfdb1457c2590c (patch)
tree7e8382598010265306d282e3aa1330d636bbf22f /packages/contract-wrappers/src/contract_wrappers
parent773cf3cd143769a93cea66b30d46cb9f4620b74d (diff)
downloaddexon-0x-contracts-1f0ac47bd97b88071a6380a728cfdb1457c2590c.tar.gz
dexon-0x-contracts-1f0ac47bd97b88071a6380a728cfdb1457c2590c.tar.zst
dexon-0x-contracts-1f0ac47bd97b88071a6380a728cfdb1457c2590c.zip
Move signature validation into OrderValidationUtils.validateOrderFillableOrThrowAsync
Diffstat (limited to 'packages/contract-wrappers/src/contract_wrappers')
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts15
1 files changed, 2 insertions, 13 deletions
diff --git a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts
index 902fc755c..d3a4e9098 100644
--- a/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts
+++ b/packages/contract-wrappers/src/contract_wrappers/exchange_wrapper.ts
@@ -1120,17 +1120,6 @@ export class ExchangeWrapper extends ContractWrapper {
assert.doesConformToSchema('signedOrder', signedOrder, schemas.signedOrderSchema);
assert.doesConformToSchema('opts', opts, validateOrderFillableOptsSchema);
- const orderHash = await orderHashUtils.getOrderHashHex(signedOrder);
- const isValidSignature = await signatureUtils.isValidSignatureAsync(
- this._web3Wrapper.getProvider(),
- orderHash,
- signedOrder.signature,
- signedOrder.makerAddress,
- );
- if (!isValidSignature) {
- throw new Error('INVALID_ORDER_SIGNATURE');
- }
-
const balanceAllowanceFetcher = new AssetBalanceAndProxyAllowanceFetcher(
this._erc20TokenWrapper,
this._erc721TokenWrapper,
@@ -1141,7 +1130,7 @@ export class ExchangeWrapper extends ContractWrapper {
const expectedFillTakerTokenAmountIfExists = opts.expectedFillTakerTokenAmount;
const filledCancelledFetcher = new OrderFilledCancelledFetcher(this, BlockParamLiteral.Latest);
- const orderValidationUtils = new OrderValidationUtils(filledCancelledFetcher);
+ const orderValidationUtils = new OrderValidationUtils(filledCancelledFetcher, this._web3Wrapper.getProvider());
await orderValidationUtils.validateOrderFillableOrThrowAsync(
exchangeTradeSimulator,
signedOrder,
@@ -1169,7 +1158,7 @@ export class ExchangeWrapper extends ContractWrapper {
const exchangeTradeSimulator = new ExchangeTransferSimulator(balanceAllowanceStore);
const filledCancelledFetcher = new OrderFilledCancelledFetcher(this, BlockParamLiteral.Latest);
- const orderValidationUtils = new OrderValidationUtils(filledCancelledFetcher);
+ const orderValidationUtils = new OrderValidationUtils(filledCancelledFetcher, this._web3Wrapper.getProvider());
await orderValidationUtils.validateFillOrderThrowIfInvalidAsync(
exchangeTradeSimulator,
this._web3Wrapper.getProvider(),