diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-11-21 05:24:45 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2018-11-29 08:38:11 +0800 |
commit | aed8b083b587e7b420ac6129b04004dea95c3f3a (patch) | |
tree | f6eacabc4061d6f616b85886a5f02d3149e16537 /packages/utils/src/abi_encoder/calldata/payload_calldata_block.ts | |
parent | e6ab6f38bacdec90c960ff1db4781d161b1f4103 (diff) | |
download | dexon-sol-tools-aed8b083b587e7b420ac6129b04004dea95c3f3a.tar dexon-sol-tools-aed8b083b587e7b420ac6129b04004dea95c3f3a.tar.gz dexon-sol-tools-aed8b083b587e7b420ac6129b04004dea95c3f3a.tar.bz2 dexon-sol-tools-aed8b083b587e7b420ac6129b04004dea95c3f3a.tar.lz dexon-sol-tools-aed8b083b587e7b420ac6129b04004dea95c3f3a.tar.xz dexon-sol-tools-aed8b083b587e7b420ac6129b04004dea95c3f3a.tar.zst dexon-sol-tools-aed8b083b587e7b420ac6129b04004dea95c3f3a.zip |
Split Calldata into multiple files - 1 class per file
Diffstat (limited to 'packages/utils/src/abi_encoder/calldata/payload_calldata_block.ts')
-rw-r--r-- | packages/utils/src/abi_encoder/calldata/payload_calldata_block.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/packages/utils/src/abi_encoder/calldata/payload_calldata_block.ts b/packages/utils/src/abi_encoder/calldata/payload_calldata_block.ts new file mode 100644 index 000000000..81a88bc19 --- /dev/null +++ b/packages/utils/src/abi_encoder/calldata/payload_calldata_block.ts @@ -0,0 +1,20 @@ +import { CalldataBlock } from './calldata_block'; + +export class PayloadCalldataBlock extends CalldataBlock { + private readonly _payload: Buffer; + + constructor(name: string, signature: string, parentName: string, payload: Buffer) { + const headerSizeInBytes = 0; + const bodySizeInBytes = payload.byteLength; + super(name, signature, parentName, headerSizeInBytes, bodySizeInBytes); + this._payload = payload; + } + + public toBuffer(): Buffer { + return this._payload; + } + + public getRawData(): Buffer { + return this._payload; + } +}
\ No newline at end of file |