aboutsummaryrefslogtreecommitdiffstats
path: root/packages/utils/src/abi_encoder/calldata/blocks/blob.ts
blob: 210ef6420268f7e9fb6b2a4b056a545c5bcff07d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { CalldataBlock } from '../calldata_block';

export class Blob extends CalldataBlock {
    private readonly _blob: Buffer;

    constructor(name: string, signature: string, parentName: string, blob: Buffer) {
        const headerSizeInBytes = 0;
        const bodySizeInBytes = blob.byteLength;
        super(name, signature, parentName, headerSizeInBytes, bodySizeInBytes);
        this._blob = blob;
    }

    public toBuffer(): Buffer {
        return this._blob;
    }

    public getRawData(): Buffer {
        return this._blob;
    }
}