diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-07-17 18:59:02 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-07-17 18:59:02 +0800 |
commit | bf8ac3b9e6ee59f267f7850418febfe84dedceb8 (patch) | |
tree | 0617e583892f9a8fe96a55dcac3a7f9af1ddae10 /packages/base-contract/src | |
parent | edcdc9b1b903158cc61529853d7e9028ecbc266a (diff) | |
download | dexon-sol-tools-bf8ac3b9e6ee59f267f7850418febfe84dedceb8.tar dexon-sol-tools-bf8ac3b9e6ee59f267f7850418febfe84dedceb8.tar.gz dexon-sol-tools-bf8ac3b9e6ee59f267f7850418febfe84dedceb8.tar.bz2 dexon-sol-tools-bf8ac3b9e6ee59f267f7850418febfe84dedceb8.tar.lz dexon-sol-tools-bf8ac3b9e6ee59f267f7850418febfe84dedceb8.tar.xz dexon-sol-tools-bf8ac3b9e6ee59f267f7850418febfe84dedceb8.tar.zst dexon-sol-tools-bf8ac3b9e6ee59f267f7850418febfe84dedceb8.zip |
Fix tslint issues
Diffstat (limited to 'packages/base-contract/src')
-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; } |