diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-11-28 05:10:34 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2018-11-29 08:38:11 +0800 |
commit | f31d4ddffd8dd97f2b2dc226f4f132d1c3192c76 (patch) | |
tree | 52cafb673165eff83d3c75938ff5298ffbd8a68c /packages/utils/src/abi_encoder/calldata/blocks/pointer.ts | |
parent | 2e79ce26cbeacdeb0ea52b7c2e3da68e8055e7c6 (diff) | |
download | dexon-sol-tools-f31d4ddffd8dd97f2b2dc226f4f132d1c3192c76.tar dexon-sol-tools-f31d4ddffd8dd97f2b2dc226f4f132d1c3192c76.tar.gz dexon-sol-tools-f31d4ddffd8dd97f2b2dc226f4f132d1c3192c76.tar.bz2 dexon-sol-tools-f31d4ddffd8dd97f2b2dc226f4f132d1c3192c76.tar.lz dexon-sol-tools-f31d4ddffd8dd97f2b2dc226f4f132d1c3192c76.tar.xz dexon-sol-tools-f31d4ddffd8dd97f2b2dc226f4f132d1c3192c76.tar.zst dexon-sol-tools-f31d4ddffd8dd97f2b2dc226f4f132d1c3192c76.zip |
Replaced null/undefined checks with lodash
Diffstat (limited to 'packages/utils/src/abi_encoder/calldata/blocks/pointer.ts')
-rw-r--r-- | packages/utils/src/abi_encoder/calldata/blocks/pointer.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/utils/src/abi_encoder/calldata/blocks/pointer.ts b/packages/utils/src/abi_encoder/calldata/blocks/pointer.ts index 1c49a8c6c..654cbe26c 100644 --- a/packages/utils/src/abi_encoder/calldata/blocks/pointer.ts +++ b/packages/utils/src/abi_encoder/calldata/blocks/pointer.ts @@ -1,4 +1,5 @@ import * as ethUtil from 'ethereumjs-util'; +import * as _ from 'lodash'; import * as Constants from '../../utils/constants'; @@ -24,7 +25,7 @@ export class Pointer extends CalldataBlock { public toBuffer(): Buffer { const destinationOffset = - this._aliasFor !== undefined ? this._aliasFor.getOffsetInBytes() : this._dependency.getOffsetInBytes(); + !_.isUndefined(this._aliasFor) ? this._aliasFor.getOffsetInBytes() : this._dependency.getOffsetInBytes(); const parentOffset = this._parent.getOffsetInBytes(); const parentHeaderSize = this._parent.getHeaderSizeInBytes(); const pointer: number = destinationOffset - (parentOffset + parentHeaderSize); |