aboutsummaryrefslogtreecommitdiffstats
path: root/packages/utils/src/abi_encoder/calldata/blocks/blob.ts
blob: 219ea6c612fab33e2407de990afe472da88cb165 (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 BlobCalldataBlock 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;
    }
}