diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-11-26 09:12:21 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2018-11-29 08:38:11 +0800 |
commit | d2d89adbddaec435ddb65545a86fc4dc981de521 (patch) | |
tree | 0b95f1e18889440e67a534131aee7e6f18c73bd0 /packages/utils/src/abi_encoder/evm_data_types/int.ts | |
parent | 58a2dfbc4d191ea21e6a749371e586dcff3b3239 (diff) | |
download | dexon-0x-contracts-d2d89adbddaec435ddb65545a86fc4dc981de521.tar dexon-0x-contracts-d2d89adbddaec435ddb65545a86fc4dc981de521.tar.gz dexon-0x-contracts-d2d89adbddaec435ddb65545a86fc4dc981de521.tar.bz2 dexon-0x-contracts-d2d89adbddaec435ddb65545a86fc4dc981de521.tar.lz dexon-0x-contracts-d2d89adbddaec435ddb65545a86fc4dc981de521.tar.xz dexon-0x-contracts-d2d89adbddaec435ddb65545a86fc4dc981de521.tar.zst dexon-0x-contracts-d2d89adbddaec435ddb65545a86fc4dc981de521.zip |
Abstracted out encoding/decoding of numeric values into its own utility. Could be useful elsewhere.
Diffstat (limited to 'packages/utils/src/abi_encoder/evm_data_types/int.ts')
-rw-r--r-- | packages/utils/src/abi_encoder/evm_data_types/int.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/utils/src/abi_encoder/evm_data_types/int.ts b/packages/utils/src/abi_encoder/evm_data_types/int.ts index ec41b9cfc..457c41b28 100644 --- a/packages/utils/src/abi_encoder/evm_data_types/int.ts +++ b/packages/utils/src/abi_encoder/evm_data_types/int.ts @@ -7,16 +7,16 @@ import { DataTypeFactory } from '../abstract_data_types'; import { Number } from './number'; export class Int extends Number { - private static readonly _matcher = RegExp( + private static readonly _MATCHER = RegExp( '^int(8|16|24|32|40|48|56|64|72|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256){0,1}$', ); public static matchType(type: string): boolean { - return Int._matcher.test(type); + return Int._MATCHER.test(type); } public constructor(dataItem: DataItem, dataTypeFactory: DataTypeFactory) { - super(dataItem, Int._matcher, dataTypeFactory); + super(dataItem, Int._MATCHER, dataTypeFactory); } public getMaxValue(): BigNumber { |