From b99252baaedd9bc37ef4e53d02e4085bed7e5142 Mon Sep 17 00:00:00 2001 From: Greg Hysen Date: Tue, 6 Nov 2018 17:18:40 -0800 Subject: ABI encodes some basic types correctly --- packages/order-utils/test/abi_encoder_test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'packages/order-utils') diff --git a/packages/order-utils/test/abi_encoder_test.ts b/packages/order-utils/test/abi_encoder_test.ts index e1d0e8a91..1a33e4f78 100644 --- a/packages/order-utils/test/abi_encoder_test.ts +++ b/packages/order-utils/test/abi_encoder_test.ts @@ -211,7 +211,7 @@ namespace AbiEncoder { this.data = []; const evmWordSize = 32; this.dataOffset = new BigNumber(nParams).times(evmWordSize); - this.currentDataOffset = this.dataOffset; + this.currentDataOffset = new BigNumber(0); this.currentParamOffset = new BigNumber(0); this.bindList = {}; } @@ -243,7 +243,7 @@ namespace AbiEncoder { } public getHexValue(): string { - let hexValue = `0x${this.selector}`; + let hexValue = `${this.selector}`; _.each(this.params, (memblock: Memblock) => { hexValue += memblock.get(); }); @@ -634,6 +634,8 @@ namespace AbiEncoder { public getHexValue(): string { let offset = new BigNumber(0); if (this.memblock !== undefined) { + console.log('Abs Offset = ', JSON.stringify(this.destDataType.getAbsoluteOffset())); + console.log('Local Offset = ', JSON.stringify(this.destDataType.getOffset())); switch (this.memblock.getSection()) { case CalldataSection.PARAMS: offset = this.destDataType.getAbsoluteOffset(); -- cgit v1.2.3