diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-11-28 05:31:44 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2018-11-29 08:38:11 +0800 |
commit | 1f693ea12142bc761f4067871d92e7d2662cf256 (patch) | |
tree | 58d352925dbdb4ad157c4a229eab7a7a3e0828b9 /packages/utils/src/abi_encoder/calldata | |
parent | 3f545da9f86856b54cd226c29174ac1ae085e35b (diff) | |
download | dexon-0x-contracts-1f693ea12142bc761f4067871d92e7d2662cf256.tar dexon-0x-contracts-1f693ea12142bc761f4067871d92e7d2662cf256.tar.gz dexon-0x-contracts-1f693ea12142bc761f4067871d92e7d2662cf256.tar.bz2 dexon-0x-contracts-1f693ea12142bc761f4067871d92e7d2662cf256.tar.lz dexon-0x-contracts-1f693ea12142bc761f4067871d92e7d2662cf256.tar.xz dexon-0x-contracts-1f693ea12142bc761f4067871d92e7d2662cf256.tar.zst dexon-0x-contracts-1f693ea12142bc761f4067871d92e7d2662cf256.zip |
Changed from <string>.startsWith to _.startsWith
Diffstat (limited to 'packages/utils/src/abi_encoder/calldata')
-rw-r--r-- | packages/utils/src/abi_encoder/calldata/calldata.ts | 2 | ||||
-rw-r--r-- | packages/utils/src/abi_encoder/calldata/raw_calldata.ts | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/packages/utils/src/abi_encoder/calldata/calldata.ts b/packages/utils/src/abi_encoder/calldata/calldata.ts index e93d63803..c57ff08c2 100644 --- a/packages/utils/src/abi_encoder/calldata/calldata.ts +++ b/packages/utils/src/abi_encoder/calldata/calldata.ts @@ -29,7 +29,7 @@ export class Calldata { * If the root block was created by a Method then a selector will likely be set. */ public setSelector(selector: string): void { - if (!selector.startsWith('0x')) { + if (!_.startsWith(selector, '0x')) { throw new Error(`Expected selector to be hex. Missing prefix '0x'`); } else if (selector.length !== Constants.HEX_SELECTOR_LENGTH_IN_CHARS) { throw new Error(`Invalid selector '${selector}'`); diff --git a/packages/utils/src/abi_encoder/calldata/raw_calldata.ts b/packages/utils/src/abi_encoder/calldata/raw_calldata.ts index dfd4cfa72..fbe592fc7 100644 --- a/packages/utils/src/abi_encoder/calldata/raw_calldata.ts +++ b/packages/utils/src/abi_encoder/calldata/raw_calldata.ts @@ -13,7 +13,7 @@ export class RawCalldata { public constructor(value: string | Buffer, hasSelector: boolean = true) { // Sanity check - if (typeof value === 'string' && !value.startsWith('0x')) { + if (typeof value === 'string' && !_.startsWith(value, '0x')) { throw new Error(`Expected raw calldata to start with '0x'`); } // Construct initial values |