aboutsummaryrefslogtreecommitdiffstats
path: root/packages/utils/src/abi_encoder/evm_data_types/pointer.ts
blob: 389e75927170e70f6fcb6e575e453088ba50d224 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { DataItem } from 'ethereum-types';

import { DataType } from '../abstract_data_types/data_type';
import { DataTypeFactory } from '../abstract_data_types/interfaces';
import { AbstractPointerDataType } from '../abstract_data_types/types/pointer';

export class PointerDataType extends AbstractPointerDataType {
    constructor(destDataType: DataType, parentDataType: DataType, dataTypeFactory: DataTypeFactory) {
        const destDataItem = destDataType.getDataItem();
        const dataItem: DataItem = { name: `ptr<${destDataItem.name}>`, type: `ptr<${destDataItem.type}>` };
        super(dataItem, dataTypeFactory, destDataType, parentDataType);
    }

    public getSignature(): string {
        return this._destination.getSignature();
    }
}