diff options
author | Olaf Tomalka <olaf@tomalka.me> | 2018-01-03 22:48:29 +0800 |
---|---|---|
committer | Olaf Tomalka <olaf@tomalka.me> | 2018-01-03 22:48:29 +0800 |
commit | f3b8bac47787a13ea4360b992bbe550bec2c3e19 (patch) | |
tree | f465267845939591e51291d265a83ed1f97bac3a /packages/abi-gen/src/utils.ts | |
parent | ce6abad97f248a3557390dd1e1ff3ae84662838f (diff) | |
download | dexon-0x-contracts-f3b8bac47787a13ea4360b992bbe550bec2c3e19.tar.gz dexon-0x-contracts-f3b8bac47787a13ea4360b992bbe550bec2c3e19.tar.zst dexon-0x-contracts-f3b8bac47787a13ea4360b992bbe550bec2c3e19.zip |
Added constructor ABIs to abi-gen
Additionally if the constructor is not existent in JSON, meaning it's
implcite with no parameters, we're
explicitly creating one, with actual JSON parameters that it should have.
Diffstat (limited to 'packages/abi-gen/src/utils.ts')
-rw-r--r-- | packages/abi-gen/src/utils.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/abi-gen/src/utils.ts b/packages/abi-gen/src/utils.ts index 764daa142..524c54a5e 100644 --- a/packages/abi-gen/src/utils.ts +++ b/packages/abi-gen/src/utils.ts @@ -1,6 +1,7 @@ import * as fs from 'fs'; import * as _ from 'lodash'; import * as path from 'path'; +import * as Web3 from 'web3'; import { ParamKind } from './types'; @@ -56,4 +57,12 @@ export const utils = { throw new Error(`Failed to read ${filename}: ${err}`); } }, + getEmptyConstructor(): Web3.ConstructorAbi { + return { + type: 'constructor', + stateMutability: 'nonpayable', + payable: false, + inputs: [], + }; + }, }; |