aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-04-11 21:00:54 +0800
committerFabio Berger <me@fabioberger.com>2018-04-11 21:00:54 +0800
commitf892b7dbf657f71f4fec177e838883de8327624b (patch)
treea8562cf591382b619af96adb55f0709f02f75af6 /packages
parentb146acc69e46d2565474bcb4d47bfa760fd26fad (diff)
downloaddexon-sol-tools-f892b7dbf657f71f4fec177e838883de8327624b.tar
dexon-sol-tools-f892b7dbf657f71f4fec177e838883de8327624b.tar.gz
dexon-sol-tools-f892b7dbf657f71f4fec177e838883de8327624b.tar.bz2
dexon-sol-tools-f892b7dbf657f71f4fec177e838883de8327624b.tar.lz
dexon-sol-tools-f892b7dbf657f71f4fec177e838883de8327624b.tar.xz
dexon-sol-tools-f892b7dbf657f71f4fec177e838883de8327624b.tar.zst
dexon-sol-tools-f892b7dbf657f71f4fec177e838883de8327624b.zip
Move NULL_BYTES to @0xproject/utils
Diffstat (limited to 'packages')
-rw-r--r--packages/0x.js/test/utils/constants.ts1
-rw-r--r--packages/contracts/test/token_registry.ts6
-rw-r--r--packages/contracts/util/constants.ts1
-rw-r--r--packages/migrations/src/migration.ts12
-rw-r--r--packages/migrations/src/utils/constants.ts3
-rw-r--r--packages/migrations/src/utils/token_info.ts24
-rw-r--r--packages/utils/CHANGELOG.json9
-rw-r--r--packages/utils/src/constants.ts1
-rw-r--r--packages/utils/src/index.ts2
9 files changed, 32 insertions, 27 deletions
diff --git a/packages/0x.js/test/utils/constants.ts b/packages/0x.js/test/utils/constants.ts
index 3b74fa863..cf030259c 100644
--- a/packages/0x.js/test/utils/constants.ts
+++ b/packages/0x.js/test/utils/constants.ts
@@ -6,5 +6,4 @@ export const constants = {
KOVAN_RPC_URL: 'https://kovan.infura.io/',
ROPSTEN_RPC_URL: 'https://ropsten.infura.io/',
ZRX_DECIMALS: 18,
- NULL_BYTES: '0x',
};
diff --git a/packages/contracts/test/token_registry.ts b/packages/contracts/test/token_registry.ts
index 12fc52dbc..4c404176b 100644
--- a/packages/contracts/test/token_registry.ts
+++ b/packages/contracts/test/token_registry.ts
@@ -1,6 +1,6 @@
import { ZeroEx } from '0x.js';
import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils';
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber, NULL_BYTES } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as chai from 'chai';
import ethUtil = require('ethereumjs-util');
@@ -66,8 +66,8 @@ describe('TokenRegistry', () => {
name: '',
symbol: '',
decimals: 0,
- ipfsHash: constants.NULL_BYTES,
- swarmHash: constants.NULL_BYTES,
+ ipfsHash: NULL_BYTES,
+ swarmHash: NULL_BYTES,
};
describe('addToken', () => {
diff --git a/packages/contracts/util/constants.ts b/packages/contracts/util/constants.ts
index 9bb090a2a..d1152e683 100644
--- a/packages/contracts/util/constants.ts
+++ b/packages/contracts/util/constants.ts
@@ -4,7 +4,6 @@ const DUMMY_TOKEN_DECIMALS = 18;
const DUMMY_TOKEN_TOTAL_SUPPLY = 0;
export const constants = {
- NULL_BYTES: '0x',
INVALID_OPCODE: 'invalid opcode',
REVERT: 'revert',
TESTRPC_NETWORK_ID: 50,
diff --git a/packages/migrations/src/migration.ts b/packages/migrations/src/migration.ts
index be899cc65..4827328fc 100644
--- a/packages/migrations/src/migration.ts
+++ b/packages/migrations/src/migration.ts
@@ -1,10 +1,8 @@
import { Deployer } from '@0xproject/deployer';
-import { BigNumber } from '@0xproject/utils';
+import { BigNumber, NULL_BYTES } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as _ from 'lodash';
-import { constants } from './utils/constants';
-
import { ContractName } from './types';
import { tokenInfo } from './utils/token_info';
@@ -51,8 +49,8 @@ export const runMigrationsAsync = async (deployer: Deployer) => {
'0x Protocol Token',
'ZRX',
18,
- constants.NULL_BYTES,
- constants.NULL_BYTES,
+ NULL_BYTES,
+ NULL_BYTES,
{
from: owner,
gas: addTokenGasEstimate,
@@ -63,8 +61,8 @@ export const runMigrationsAsync = async (deployer: Deployer) => {
'Ether Token',
'WETH',
18,
- constants.NULL_BYTES,
- constants.NULL_BYTES,
+ NULL_BYTES,
+ NULL_BYTES,
{
from: owner,
gas: addTokenGasEstimate,
diff --git a/packages/migrations/src/utils/constants.ts b/packages/migrations/src/utils/constants.ts
deleted file mode 100644
index 8871a470d..000000000
--- a/packages/migrations/src/utils/constants.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export const constants = {
- NULL_BYTES: '0x',
-};
diff --git a/packages/migrations/src/utils/token_info.ts b/packages/migrations/src/utils/token_info.ts
index f2ca3e8b3..968665c7d 100644
--- a/packages/migrations/src/utils/token_info.ts
+++ b/packages/migrations/src/utils/token_info.ts
@@ -1,41 +1,41 @@
-import { Token } from '../types';
+import { NULL_BYTES } from '@0xproject/utils';
-import { constants } from './constants';
+import { Token } from '../types';
export const tokenInfo: Token[] = [
{
name: 'Augur Reputation Token',
symbol: 'REP',
decimals: 18,
- ipfsHash: constants.NULL_BYTES,
- swarmHash: constants.NULL_BYTES,
+ ipfsHash: NULL_BYTES,
+ swarmHash: NULL_BYTES,
},
{
name: 'Digix DAO Token',
symbol: 'DGD',
decimals: 18,
- ipfsHash: constants.NULL_BYTES,
- swarmHash: constants.NULL_BYTES,
+ ipfsHash: NULL_BYTES,
+ swarmHash: NULL_BYTES,
},
{
name: 'Golem Network Token',
symbol: 'GNT',
decimals: 18,
- ipfsHash: constants.NULL_BYTES,
- swarmHash: constants.NULL_BYTES,
+ ipfsHash: NULL_BYTES,
+ swarmHash: NULL_BYTES,
},
{
name: 'MakerDAO',
symbol: 'MKR',
decimals: 18,
- ipfsHash: constants.NULL_BYTES,
- swarmHash: constants.NULL_BYTES,
+ ipfsHash: NULL_BYTES,
+ swarmHash: NULL_BYTES,
},
{
name: 'Melon Token',
symbol: 'MLN',
decimals: 18,
- ipfsHash: constants.NULL_BYTES,
- swarmHash: constants.NULL_BYTES,
+ ipfsHash: NULL_BYTES,
+ swarmHash: NULL_BYTES,
},
];
diff --git a/packages/utils/CHANGELOG.json b/packages/utils/CHANGELOG.json
index 0c71963c3..3ba1f7d01 100644
--- a/packages/utils/CHANGELOG.json
+++ b/packages/utils/CHANGELOG.json
@@ -1,5 +1,14 @@
[
{
+ "version": "0.5.1",
+ "changes": [
+ {
+ "note": "Export NULL_BYTES constant",
+ "pr": 500
+ }
+ ]
+ },
+ {
"version": "0.5.0",
"changes": [
{
diff --git a/packages/utils/src/constants.ts b/packages/utils/src/constants.ts
new file mode 100644
index 000000000..2894d4747
--- /dev/null
+++ b/packages/utils/src/constants.ts
@@ -0,0 +1 @@
+export const NULL_BYTES = '0x';
diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts
index 0da4b265d..75c096ee6 100644
--- a/packages/utils/src/index.ts
+++ b/packages/utils/src/index.ts
@@ -6,3 +6,5 @@ export { BigNumber } from './configured_bignumber';
export { AbiDecoder } from './abi_decoder';
export { logUtils } from './log_utils';
export { abiUtils } from './abi_utils';
+
+export { NULL_BYTES } from './constants';