From 3bf5a4e83f57f82090a64fc76fcc7bf3f7c68607 Mon Sep 17 00:00:00 2001 From: Greg Hysen Date: Sun, 25 Nov 2018 21:20:46 -0800 Subject: Moved some consts outside of a loop --- packages/utils/src/abi_encoder/calldata/calldata.ts | 11 ++++++----- 1 file 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 let offsetStr = ''; let valueStr = ''; -- cgit