diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-07-18 20:54:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-18 20:54:47 +0800 |
commit | f3241ff86a0d99f4291c5a5f4eaaa5ebe1736da0 (patch) | |
tree | 4aacfa2652ba2c5f976e36ac25449decb561d3f0 /packages/base-contract/src/index.ts | |
parent | 904968cf4a899642d3f4e78abc53352125e17447 (diff) | |
parent | bf8ac3b9e6ee59f267f7850418febfe84dedceb8 (diff) | |
download | dexon-sol-tools-f3241ff86a0d99f4291c5a5f4eaaa5ebe1736da0.tar dexon-sol-tools-f3241ff86a0d99f4291c5a5f4eaaa5ebe1736da0.tar.gz dexon-sol-tools-f3241ff86a0d99f4291c5a5f4eaaa5ebe1736da0.tar.bz2 dexon-sol-tools-f3241ff86a0d99f4291c5a5f4eaaa5ebe1736da0.tar.lz dexon-sol-tools-f3241ff86a0d99f4291c5a5f4eaaa5ebe1736da0.tar.xz dexon-sol-tools-f3241ff86a0d99f4291c5a5f4eaaa5ebe1736da0.tar.zst dexon-sol-tools-f3241ff86a0d99f4291c5a5f4eaaa5ebe1736da0.zip |
Merge pull request #883 from 0xProject/feature/tslint-improvements
New tslint rules
Diffstat (limited to 'packages/base-contract/src/index.ts')
-rw-r--r-- | packages/base-contract/src/index.ts | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/packages/base-contract/src/index.ts b/packages/base-contract/src/index.ts index 6b970ec27..a240fb8b6 100644 --- a/packages/base-contract/src/index.ts +++ b/packages/base-contract/src/index.ts @@ -72,15 +72,13 @@ export class BaseContract { // 1. Optional param passed in to public method call // 2. Global config passed in at library instantiation // 3. Gas estimate calculation + safety margin - const removeUndefinedProperties = _.pickBy; - const txDataWithDefaults: TxData = { + const removeUndefinedProperties = _.pickBy.bind(_); + const txDataWithDefaults = { ...removeUndefinedProperties(txDefaults), - ...removeUndefinedProperties(txData as any), - // HACK: TS can't prove that T is spreadable. - // Awaiting https://github.com/Microsoft/TypeScript/pull/13288 to be merged - } as any; + ...removeUndefinedProperties(txData), + }; if (_.isUndefined(txDataWithDefaults.gas) && !_.isUndefined(estimateGasAsync)) { - txDataWithDefaults.gas = await estimateGasAsync(txDataWithDefaults as any); + txDataWithDefaults.gas = await estimateGasAsync(txDataWithDefaults); } return txDataWithDefaults; } |