diff options
author | Leonid <logvinov.leon@gmail.com> | 2018-01-10 18:18:51 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-10 18:18:51 +0800 |
commit | a39d3d723399e124ae617dfda67e754907312a98 (patch) | |
tree | 2084e27bad0dede62d99165453f9ec092ea8d1be /packages/abi-gen | |
parent | 40c7ee63557b1795340c315eb9fab1dcfe092bed (diff) | |
parent | 326a6b729fe6cf96f0b4787d84903282738b6863 (diff) | |
download | dexon-sol-tools-a39d3d723399e124ae617dfda67e754907312a98.tar dexon-sol-tools-a39d3d723399e124ae617dfda67e754907312a98.tar.gz dexon-sol-tools-a39d3d723399e124ae617dfda67e754907312a98.tar.bz2 dexon-sol-tools-a39d3d723399e124ae617dfda67e754907312a98.tar.lz dexon-sol-tools-a39d3d723399e124ae617dfda67e754907312a98.tar.xz dexon-sol-tools-a39d3d723399e124ae617dfda67e754907312a98.tar.zst dexon-sol-tools-a39d3d723399e124ae617dfda67e754907312a98.zip |
Merge pull request #305 from 0xProject/fix/bignumber_config
Use configured version of bignumber in all packages
Diffstat (limited to 'packages/abi-gen')
-rw-r--r-- | packages/abi-gen/package.json | 2 | ||||
-rw-r--r-- | packages/abi-gen/src/utils.ts | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/packages/abi-gen/package.json b/packages/abi-gen/package.json index fbf3db687..50efc43a1 100644 --- a/packages/abi-gen/package.json +++ b/packages/abi-gen/package.json @@ -22,7 +22,7 @@ }, "homepage": "https://github.com/0xProject/0x.js/packages/abi-gen/README.md", "dependencies": { - "bignumber.js": "~4.1.0", + "@0xproject/utils": "^0.1.2", "chalk": "^2.3.0", "glob": "^7.1.2", "handlebars": "^4.0.11", diff --git a/packages/abi-gen/src/utils.ts b/packages/abi-gen/src/utils.ts index 524c54a5e..f6291d98d 100644 --- a/packages/abi-gen/src/utils.ts +++ b/packages/abi-gen/src/utils.ts @@ -11,7 +11,9 @@ export const utils = { if (solType.match(trailingArrayRegex)) { const arrayItemSolType = solType.replace(trailingArrayRegex, ''); const arrayItemTsType = utils.solTypeToTsType(paramKind, arrayItemSolType); - const arrayTsType = `(${arrayItemTsType})[]`; + const arrayTsType = utils.isUnionType(arrayItemTsType) + ? `Array<${arrayItemTsType}>` + : `${arrayItemTsType}[]`; return arrayTsType; } else { const solTypeRegexToTsType = [ @@ -38,6 +40,9 @@ export const utils = { throw new Error(`Unknown Solidity type found: ${solType}`); } }, + isUnionType(tsType: string): boolean { + return tsType === 'number|BigNumber'; + }, log(...args: any[]): void { console.log(...args); // tslint:disable-line:no-console }, |