aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/libraries
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-07-18 17:32:01 +0800
committerFabio Berger <me@fabioberger.com>2018-07-18 17:32:01 +0800
commit25160d7344f9e1616654dfe09a24d8fc69fa8036 (patch)
tree2ec339700c0a1da1453671719e055692142c5efd /packages/contracts/test/libraries
parent50ed7d2af26d6210f869352ed41084875d2af3d0 (diff)
downloaddexon-0x-contracts-25160d7344f9e1616654dfe09a24d8fc69fa8036.tar.gz
dexon-0x-contracts-25160d7344f9e1616654dfe09a24d8fc69fa8036.tar.zst
dexon-0x-contracts-25160d7344f9e1616654dfe09a24d8fc69fa8036.zip
Move encodeUint256 & decodeUint256 out of assetDataUtils since we don't want them exported
Diffstat (limited to 'packages/contracts/test/libraries')
-rw-r--r--packages/contracts/test/libraries/lib_bytes.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/contracts/test/libraries/lib_bytes.ts b/packages/contracts/test/libraries/lib_bytes.ts
index 3489564c0..95e05046b 100644
--- a/packages/contracts/test/libraries/lib_bytes.ts
+++ b/packages/contracts/test/libraries/lib_bytes.ts
@@ -12,6 +12,7 @@ import { artifacts } from '../utils/artifacts';
import { expectContractCallFailed } from '../utils/assertions';
import { chaiSetup } from '../utils/chai_setup';
import { constants } from '../utils/constants';
+import { typeEncodingUtils } from '../utils/type_encoding_utils';
import { provider, txDefaults, web3Wrapper } from '../utils/web3_wrapper';
chaiSetup.configure();
@@ -74,20 +75,20 @@ describe('LibBytes', () => {
shortData = '0xffffaa';
const encodedShortData = ethUtil.toBuffer(shortData);
const shortDataLength = new BigNumber(encodedShortData.byteLength);
- const encodedShortDataLength = assetDataUtils.encodeUint256(shortDataLength);
+ const encodedShortDataLength = typeEncodingUtils.encodeUint256(shortDataLength);
shortTestBytesAsBuffer = Buffer.concat([encodedShortDataLength, encodedShortData]);
shortTestBytes = ethUtil.bufferToHex(shortTestBytesAsBuffer);
// Create test bytes one word in length
- wordOfData = ethUtil.bufferToHex(assetDataUtils.encodeUint256(generatePseudoRandomSalt()));
+ wordOfData = ethUtil.bufferToHex(typeEncodingUtils.encodeUint256(generatePseudoRandomSalt()));
const encodedWordOfData = ethUtil.toBuffer(wordOfData);
const wordOfDataLength = new BigNumber(encodedWordOfData.byteLength);
- const encodedWordOfDataLength = assetDataUtils.encodeUint256(wordOfDataLength);
+ const encodedWordOfDataLength = typeEncodingUtils.encodeUint256(wordOfDataLength);
wordOfTestBytesAsBuffer = Buffer.concat([encodedWordOfDataLength, encodedWordOfData]);
wordOfTestBytes = ethUtil.bufferToHex(wordOfTestBytesAsBuffer);
// Create long test bytes (combines short test bytes with word of test bytes)
longData = ethUtil.bufferToHex(Buffer.concat([encodedShortData, encodedWordOfData]));
const longDataLength = new BigNumber(encodedShortData.byteLength + encodedWordOfData.byteLength);
- const encodedLongDataLength = assetDataUtils.encodeUint256(longDataLength);
+ const encodedLongDataLength = typeEncodingUtils.encodeUint256(longDataLength);
longTestBytesAsBuffer = Buffer.concat([encodedLongDataLength, encodedShortData, encodedWordOfData]);
longTestBytes = ethUtil.bufferToHex(longTestBytesAsBuffer);
});