aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorGreg Hysen <greg.hysen@gmail.com>2018-11-07 09:18:40 +0800
committerGreg Hysen <greg.hysen@gmail.com>2018-11-29 08:38:10 +0800
commitb99252baaedd9bc37ef4e53d02e4085bed7e5142 (patch)
tree774c2199601660d748e6062334d7faeffd02e40c /packages
parent7196046e2f38aba4709f61d1a88eb562d6c0a38a (diff)
downloaddexon-sol-tools-b99252baaedd9bc37ef4e53d02e4085bed7e5142.tar
dexon-sol-tools-b99252baaedd9bc37ef4e53d02e4085bed7e5142.tar.gz
dexon-sol-tools-b99252baaedd9bc37ef4e53d02e4085bed7e5142.tar.bz2
dexon-sol-tools-b99252baaedd9bc37ef4e53d02e4085bed7e5142.tar.lz
dexon-sol-tools-b99252baaedd9bc37ef4e53d02e4085bed7e5142.tar.xz
dexon-sol-tools-b99252baaedd9bc37ef4e53d02e4085bed7e5142.tar.zst
dexon-sol-tools-b99252baaedd9bc37ef4e53d02e4085bed7e5142.zip
ABI encodes some basic types correctly
Diffstat (limited to 'packages')
-rw-r--r--packages/order-utils/test/abi_encoder_test.ts6
1 files changed, 4 insertions, 2 deletions
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();