diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-11-26 13:20:46 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2018-11-29 08:38:11 +0800 |
commit | 3bf5a4e83f57f82090a64fc76fcc7bf3f7c68607 (patch) | |
tree | 40c39bcd9bc4a1a960a0cbe1214d696ef132449e /packages/utils/src/abi_encoder/calldata | |
parent | 50344fa24a4a708ae90030af107afb15366f883f (diff) | |
download | dexon-0x-contracts-3bf5a4e83f57f82090a64fc76fcc7bf3f7c68607.tar dexon-0x-contracts-3bf5a4e83f57f82090a64fc76fcc7bf3f7c68607.tar.gz dexon-0x-contracts-3bf5a4e83f57f82090a64fc76fcc7bf3f7c68607.tar.bz2 dexon-0x-contracts-3bf5a4e83f57f82090a64fc76fcc7bf3f7c68607.tar.lz dexon-0x-contracts-3bf5a4e83f57f82090a64fc76fcc7bf3f7c68607.tar.xz dexon-0x-contracts-3bf5a4e83f57f82090a64fc76fcc7bf3f7c68607.tar.zst dexon-0x-contracts-3bf5a4e83f57f82090a64fc76fcc7bf3f7c68607.zip |
Moved some consts outside of a loop
Diffstat (limited to 'packages/utils/src/abi_encoder/calldata')
-rw-r--r-- | packages/utils/src/abi_encoder/calldata/calldata.ts | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/packages/utils/src/abi_encoder/calldata/calldata.ts b/packages/utils/src/abi_encoder/calldata/calldata.ts index da61b2256..668b92f06 100644 --- a/packages/utils/src/abi_encoder/calldata/calldata.ts +++ b/packages/utils/src/abi_encoder/calldata/calldata.ts @@ -178,6 +178,12 @@ export class Calldata { if (this._root === undefined) { throw new Error('expected root'); } + // Constants for constructing annotated string + const offsetPadding = 10; + const valuePadding = 74; + const namePadding = 80; + const evmWordStartIndex = 0; + const emptySize = 0; // Construct annotated calldata let hexValue = `${this._selector}`; let offset = 0; @@ -189,11 +195,6 @@ export class Calldata { const name = block.getName(); const parentName = block.getParentName(); const prettyName = name.replace(`${parentName}.`, '').replace(`${functionName}.`, ''); - const offsetPadding = 10; - const valuePadding = 74; - const namePadding = 80; - const evmWordStartIndex = 0; - const emptySize = 0; // Resulting line will be <offsetStr><valueStr><nameStr> let offsetStr = ''; let valueStr = ''; |