diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-11-10 13:59:37 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2018-11-29 08:38:10 +0800 |
commit | 20f1526c7d0e1edb4a1de8e8a26811ae81b609dc (patch) | |
tree | aa2e3e3229521fd6ee5c7fdee3a8271bc960498e /packages | |
parent | addfe85f088fc1aa31638acdd73bae560afceb27 (diff) | |
download | dexon-sol-tools-20f1526c7d0e1edb4a1de8e8a26811ae81b609dc.tar dexon-sol-tools-20f1526c7d0e1edb4a1de8e8a26811ae81b609dc.tar.gz dexon-sol-tools-20f1526c7d0e1edb4a1de8e8a26811ae81b609dc.tar.bz2 dexon-sol-tools-20f1526c7d0e1edb4a1de8e8a26811ae81b609dc.tar.lz dexon-sol-tools-20f1526c7d0e1edb4a1de8e8a26811ae81b609dc.tar.xz dexon-sol-tools-20f1526c7d0e1edb4a1de8e8a26811ae81b609dc.tar.zst dexon-sol-tools-20f1526c7d0e1edb4a1de8e8a26811ae81b609dc.zip |
arrays working
Diffstat (limited to 'packages')
-rw-r--r-- | packages/order-utils/test/abi/calldata.ts | 2 | ||||
-rw-r--r-- | packages/order-utils/test/abi/data_type.ts | 4 | ||||
-rw-r--r-- | packages/order-utils/test/abi_encoder_test.ts | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/packages/order-utils/test/abi/calldata.ts b/packages/order-utils/test/abi/calldata.ts index 74f0c0924..c1630c34a 100644 --- a/packages/order-utils/test/abi/calldata.ts +++ b/packages/order-utils/test/abi/calldata.ts @@ -96,7 +96,7 @@ export class DependentCalldataBlock extends CalldataBlock { console.log("Parent Offset - ", parentOffset); const parentHeaderSize = this.parent.getHeaderSizeInBytes(); console.log("Parent Header size - ", parentHeaderSize); - const pointer: number = (dependencyOffset - parentOffset) + parentHeaderSize; + const pointer: number = dependencyOffset - (parentOffset + parentHeaderSize); console.log("DAT PTR = ", pointer); const pointerBuf = ethUtil.toBuffer(`0x${pointer.toString(16)}`); console.log("Chye - ", pointerBuf); diff --git a/packages/order-utils/test/abi/data_type.ts b/packages/order-utils/test/abi/data_type.ts index 5311ffb81..72d270bf1 100644 --- a/packages/order-utils/test/abi/data_type.ts +++ b/packages/order-utils/test/abi/data_type.ts @@ -102,6 +102,8 @@ export abstract class MemberDataType extends DataType { public constructor(dataItem: DataItem, isArray: boolean = false, arrayLength?: number, arrayElementType?: string) { super(dataItem); + console.log('*'.repeat(40), arrayLength); + this.memberMap = {}; this.members = []; this.isArray = isArray; @@ -243,7 +245,7 @@ export abstract class MemberDataType extends DataType { */ if (this.isArray && this.arrayLength === undefined) { - return true; + return false; } // Search for dependent members diff --git a/packages/order-utils/test/abi_encoder_test.ts b/packages/order-utils/test/abi_encoder_test.ts index e600542b8..4c571434e 100644 --- a/packages/order-utils/test/abi_encoder_test.ts +++ b/packages/order-utils/test/abi_encoder_test.ts @@ -259,7 +259,7 @@ describe.only('ABI Encoder', () => { expect(calldata).to.be.equal(expectedCalldata); }); - it('Fixed Lenfgth Array / Dynamic Members', async () => { + it.only('Fixed Lenfgth Array / Dynamic Members', async () => { const method = new AbiEncoder.Method(AbiSamples.staticArrayDynamicMembersAbi); const args = [["Brave", "New", "World"]]; const calldata = method.encode(args); @@ -303,7 +303,7 @@ describe.only('ABI Encoder', () => { }); - it.only('Fixed Length Array / Static Members ABI', async () => { + it('Fixed Length Array / Static Members ABI', async () => { const method = new AbiEncoder.Method(AbiSamples.staticArrayAbi); const args = [[new BigNumber(127), new BigNumber(14), new BigNumber(54)]]; const calldata = method.encode(args); |