diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-11-10 15:00:20 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2018-11-29 08:38:10 +0800 |
commit | bb7dd2373893366dcab0fe1c4cffe0c1e31af837 (patch) | |
tree | 19daf64bf9aba4edada4ef3c4014f066ded90fb1 /packages/order-utils/test/abi/data_type.ts | |
parent | 59206c387e702492d22e975acf806ebe7de36bfd (diff) | |
download | dexon-sol-tools-bb7dd2373893366dcab0fe1c4cffe0c1e31af837.tar dexon-sol-tools-bb7dd2373893366dcab0fe1c4cffe0c1e31af837.tar.gz dexon-sol-tools-bb7dd2373893366dcab0fe1c4cffe0c1e31af837.tar.bz2 dexon-sol-tools-bb7dd2373893366dcab0fe1c4cffe0c1e31af837.tar.lz dexon-sol-tools-bb7dd2373893366dcab0fe1c4cffe0c1e31af837.tar.xz dexon-sol-tools-bb7dd2373893366dcab0fe1c4cffe0c1e31af837.tar.zst dexon-sol-tools-bb7dd2373893366dcab0fe1c4cffe0c1e31af837.zip |
passing 18 tests
Diffstat (limited to 'packages/order-utils/test/abi/data_type.ts')
-rw-r--r-- | packages/order-utils/test/abi/data_type.ts | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/packages/order-utils/test/abi/data_type.ts b/packages/order-utils/test/abi/data_type.ts index 0783b9c56..7f110c4fc 100644 --- a/packages/order-utils/test/abi/data_type.ts +++ b/packages/order-utils/test/abi/data_type.ts @@ -43,7 +43,7 @@ export abstract class PayloadDataType extends DataType { public encode(value: any, calldata: Calldata): void { const block = this.generateCalldataBlock(value); - calldata.setRoot(block); + // calldata.setRoot(block); } public isStatic(): boolean { @@ -78,7 +78,7 @@ export abstract class DependentDataType extends DataType { public encode(value: any, calldata: Calldata = new Calldata()): void { const block = this.generateCalldataBlock(value); - calldata.setRoot(block); + //calldata.setRoot(block); } public isStatic(): boolean { @@ -125,15 +125,20 @@ export abstract class MemberDataType extends DataType { type: memberItem.type, name: `${dataItem.name}.${memberItem.name}`, } as DataItem; + const components = memberItem.components; + if (components !== undefined) { + childDataItem.components = components; + } const child = DataTypeFactory.create(childDataItem, this); + memberMap[memberItem.name] = members.length; members.push(child); - memberMap[dataItem.name] = members.length; }); return [members, memberMap]; } private createMembersWithLength(dataItem: DataItem, length: number): [DataType[], MemberMap] { + console.log('!'.repeat(30), dataItem); let members: DataType[] = []; let memberMap: MemberMap = {}; const range = _.range(length); @@ -147,8 +152,8 @@ export abstract class MemberDataType extends DataType { childDataItem.components = components; } const child = DataTypeFactory.create(childDataItem, this); - members.push(child); memberMap[idx.toString(10)] = members.length; + members.push(child); }); return [members, memberMap]; |