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/evm_data_types | |
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/evm_data_types')
3 files changed, 3 insertions, 3 deletions
diff --git a/packages/utils/src/abi_encoder/evm_data_types/address.ts b/packages/utils/src/abi_encoder/evm_data_types/address.ts index 71aa293b5..52fc8e7b9 100644 --- a/packages/utils/src/abi_encoder/evm_data_types/address.ts +++ b/packages/utils/src/abi_encoder/evm_data_types/address.ts @@ -31,7 +31,7 @@ export class Address extends AbstractDataTypes.Blob { } public encodeValue(value: string): Buffer { - if (!value.startsWith('0x')) { + if (!_.startsWith(value, '0x')) { throw new Error(Address.ERROR_MESSAGE_ADDRESS_MUST_START_WITH_0X); } const valueBuf = ethUtil.toBuffer(value); diff --git a/packages/utils/src/abi_encoder/evm_data_types/dynamic_bytes.ts b/packages/utils/src/abi_encoder/evm_data_types/dynamic_bytes.ts index 01d83d11a..98d90b7e4 100644 --- a/packages/utils/src/abi_encoder/evm_data_types/dynamic_bytes.ts +++ b/packages/utils/src/abi_encoder/evm_data_types/dynamic_bytes.ts @@ -60,7 +60,7 @@ export class DynamicBytes extends AbstractDataTypes.Blob { if (typeof value !== 'string') { return; } - if (!value.startsWith('0x')) { + if (!_.startsWith(value, '0x')) { throw new Error(`Tried to encode non-hex value. Value must inlcude '0x' prefix.`); } else if (value.length % 2 !== 0) { throw new Error(`Tried to assign ${value}, which is contains a half-byte. Use full bytes only.`); diff --git a/packages/utils/src/abi_encoder/evm_data_types/static_bytes.ts b/packages/utils/src/abi_encoder/evm_data_types/static_bytes.ts index 3a2ad410f..68f212f79 100644 --- a/packages/utils/src/abi_encoder/evm_data_types/static_bytes.ts +++ b/packages/utils/src/abi_encoder/evm_data_types/static_bytes.ts @@ -59,7 +59,7 @@ export class StaticBytes extends AbstractDataTypes.Blob { private _sanityCheckValue(value: string | Buffer): void { if (typeof value === 'string') { - if (!value.startsWith('0x')) { + if (!_.startsWith(value, '0x')) { throw new Error(`Tried to encode non-hex value. Value must inlcude '0x' prefix.`); } else if (value.length % 2 !== 0) { throw new Error(`Tried to assign ${value}, which is contains a half-byte. Use full bytes only.`); |