From 3027e6bc0db9d0722f0dcf09f84505ad8440e65b Mon Sep 17 00:00:00 2001 From: Greg Hysen Date: Fri, 9 Nov 2018 20:18:23 -0800 Subject: resolved issue with value.greaterThan --- packages/order-utils/test/abi/data_type.ts | 5 +++-- packages/order-utils/test/abi/evm_data_types.ts | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/order-utils/test/abi/data_type.ts b/packages/order-utils/test/abi/data_type.ts index c1e352508..be7ae6154 100644 --- a/packages/order-utils/test/abi/data_type.ts +++ b/packages/order-utils/test/abi/data_type.ts @@ -32,6 +32,7 @@ export abstract class PayloadDataType extends DataType { } public generateCalldataBlock(value: any, parentBlock?: CalldataBlock): PayloadCalldataBlock { + //console.log(); const encodedValue = this.encodeValue(value); const name = this.getDataItem().name; const signature = this.getSignature(); @@ -173,8 +174,8 @@ export abstract class MemberDataType extends DataType { const methodBlock: MemberCalldataBlock = new MemberCalldataBlock(this.getDataItem().name, this.getSignature(), false); const memberBlocks: CalldataBlock[] = []; - _.each(members, (member: DataType) => { - const block = member.generateCalldataBlock(value, methodBlock); + _.each(members, (member: DataType, idx: number) => { + const block = member.generateCalldataBlock(value[idx], methodBlock); memberBlocks.push(block); }); methodBlock.setMembers(memberBlocks); diff --git a/packages/order-utils/test/abi/evm_data_types.ts b/packages/order-utils/test/abi/evm_data_types.ts index 1bd4f0d51..fcced646a 100644 --- a/packages/order-utils/test/abi/evm_data_types.ts +++ b/packages/order-utils/test/abi/evm_data_types.ts @@ -86,6 +86,7 @@ abstract class Number extends PayloadDataType { } public encodeValue(value: BigNumber): Buffer { + console.log(value); if (value.greaterThan(this.getMaxValue())) { throw `tried to assign value of ${value}, which exceeds max value of ${this.getMaxValue()}`; } else if (value.lessThan(this.getMinValue())) { -- cgit