diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-11-26 10:24:46 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2018-11-29 08:38:11 +0800 |
commit | 9a51af46ee4a35b3d1ce2fcdc6f561aa68307cf0 (patch) | |
tree | 1978be0aa6086aeba0337d37dae01e26871278f9 /packages/utils/src/abi_encoder/calldata/calldata.ts | |
parent | bb4d02e413119132f283ee17549cf5e1732d75b5 (diff) | |
download | dexon-0x-contracts-9a51af46ee4a35b3d1ce2fcdc6f561aa68307cf0.tar dexon-0x-contracts-9a51af46ee4a35b3d1ce2fcdc6f561aa68307cf0.tar.gz dexon-0x-contracts-9a51af46ee4a35b3d1ce2fcdc6f561aa68307cf0.tar.bz2 dexon-0x-contracts-9a51af46ee4a35b3d1ce2fcdc6f561aa68307cf0.tar.lz dexon-0x-contracts-9a51af46ee4a35b3d1ce2fcdc6f561aa68307cf0.tar.xz dexon-0x-contracts-9a51af46ee4a35b3d1ce2fcdc6f561aa68307cf0.tar.zst dexon-0x-contracts-9a51af46ee4a35b3d1ce2fcdc6f561aa68307cf0.zip |
Payload -> Blob, Dependent -> Pointer, Member -> Set
Diffstat (limited to 'packages/utils/src/abi_encoder/calldata/calldata.ts')
-rw-r--r-- | packages/utils/src/abi_encoder/calldata/calldata.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/utils/src/abi_encoder/calldata/calldata.ts b/packages/utils/src/abi_encoder/calldata/calldata.ts index 3b85f821b..b2396ee8f 100644 --- a/packages/utils/src/abi_encoder/calldata/calldata.ts +++ b/packages/utils/src/abi_encoder/calldata/calldata.ts @@ -5,8 +5,8 @@ import * as Constants from '../utils/constants'; import { Queue } from '../utils/queue'; import { EncodingRules } from '../utils/rules'; +import * as CalldataBlocks from './blocks'; import { CalldataBlock } from './calldata_block'; -import * as CalldataBlocks from './calldata_blocks'; export class Calldata { private readonly _rules: EncodingRules; @@ -18,7 +18,7 @@ export class Calldata { const blockQueue = new Queue<CalldataBlock>(); // Base Case - if (!(block instanceof CalldataBlocks.MemberCalldataBlock)) { + if (!(block instanceof CalldataBlocks.Set)) { blockQueue.pushBack(block); return blockQueue; } @@ -26,7 +26,7 @@ export class Calldata { // This is a Member Block const memberBlock = block; _.eachRight(memberBlock.getMembers(), (member: CalldataBlock) => { - if (member instanceof CalldataBlocks.MemberCalldataBlock) { + if (member instanceof CalldataBlocks.Set) { blockQueue.mergeFront(Calldata._createQueue(member)); } else { blockQueue.pushFront(member); @@ -35,9 +35,9 @@ export class Calldata { // Children _.each(memberBlock.getMembers(), (member: CalldataBlock) => { - if (member instanceof CalldataBlocks.DependentCalldataBlock && member.getAlias() === undefined) { + if (member instanceof CalldataBlocks.Pointer && member.getAlias() === undefined) { const dependency = member.getDependency(); - if (dependency instanceof CalldataBlocks.MemberCalldataBlock) { + if (dependency instanceof CalldataBlocks.Set) { blockQueue.mergeBack(Calldata._createQueue(dependency)); } else { blockQueue.pushBack(dependency); @@ -68,7 +68,7 @@ export class Calldata { const subtreeQueue = Calldata._createQueue(this._root); let block: CalldataBlock | undefined; for (block = subtreeQueue.popBack(); block !== undefined; block = subtreeQueue.popBack()) { - if (block instanceof CalldataBlocks.DependentCalldataBlock) { + if (block instanceof CalldataBlocks.Pointer) { const dependencyBlockHashBuf = block.getDependency().computeHash(); const dependencyBlockHash = ethUtil.bufferToHex(dependencyBlockHashBuf); if (dependencyBlockHash in blocksByHash) { @@ -175,7 +175,7 @@ export class Calldata { ), ) .padEnd(valuePadding); - if (block instanceof CalldataBlocks.MemberCalldataBlock) { + if (block instanceof CalldataBlocks.Set) { nameStr = `### ${prettyName.padEnd(namePadding)}`; line = `\n${offsetStr}${value}${nameStr}`; } else { |