aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Hysen <greg.hysen@gmail.com>2018-11-10 12:18:23 +0800
committerGreg Hysen <greg.hysen@gmail.com>2018-11-29 08:38:10 +0800
commit3027e6bc0db9d0722f0dcf09f84505ad8440e65b (patch)
tree375b2d947b945d84dc315c3c24fedac6205c8aa0
parent41e01e98064b129f588d72ed25267f4865c58f5c (diff)
downloaddexon-sol-tools-3027e6bc0db9d0722f0dcf09f84505ad8440e65b.tar
dexon-sol-tools-3027e6bc0db9d0722f0dcf09f84505ad8440e65b.tar.gz
dexon-sol-tools-3027e6bc0db9d0722f0dcf09f84505ad8440e65b.tar.bz2
dexon-sol-tools-3027e6bc0db9d0722f0dcf09f84505ad8440e65b.tar.lz
dexon-sol-tools-3027e6bc0db9d0722f0dcf09f84505ad8440e65b.tar.xz
dexon-sol-tools-3027e6bc0db9d0722f0dcf09f84505ad8440e65b.tar.zst
dexon-sol-tools-3027e6bc0db9d0722f0dcf09f84505ad8440e65b.zip
resolved issue with value.greaterThan
-rw-r--r--packages/order-utils/test/abi/data_type.ts5
-rw-r--r--packages/order-utils/test/abi/evm_data_types.ts1
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())) {