aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/libraries/lib_bytes.ts
diff options
context:
space:
mode:
authorRemco Bloemen <remco@wicked.ventures>2018-06-14 00:28:11 +0800
committerRemco Bloemen <remco@wicked.ventures>2018-06-23 19:53:38 +0800
commit943e556f43a328dbb606567b06392851ba4ec3de (patch)
treecbafa8d8ab8e323683b0e31ee7ba34b19a2a67c3 /packages/contracts/test/libraries/lib_bytes.ts
parent4bf4f96f478ba8e08bf2d44817294ddd5fe895c5 (diff)
downloaddexon-sol-tools-943e556f43a328dbb606567b06392851ba4ec3de.tar.gz
dexon-sol-tools-943e556f43a328dbb606567b06392851ba4ec3de.tar.zst
dexon-sol-tools-943e556f43a328dbb606567b06392851ba4ec3de.zip
Refactor LibBytes.readBytes4 for consistency
Diffstat (limited to 'packages/contracts/test/libraries/lib_bytes.ts')
-rw-r--r--packages/contracts/test/libraries/lib_bytes.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/packages/contracts/test/libraries/lib_bytes.ts b/packages/contracts/test/libraries/lib_bytes.ts
index 5edb5835a..8dc968ed7 100644
--- a/packages/contracts/test/libraries/lib_bytes.ts
+++ b/packages/contracts/test/libraries/lib_bytes.ts
@@ -459,17 +459,21 @@ describe('LibBytes', () => {
});
});
- describe('readFirst4', () => {
+ describe('readBytes4', () => {
// AssertionError: expected promise to be rejected with an error including 'revert' but it was fulfilled with '0x08c379a0'
it('should revert if byte array has a length < 4', async () => {
const byteArrayLessThan4Bytes = '0x010101';
return expectRevertOrOtherErrorAsync(
- libBytes.publicReadFirst4.callAsync(byteArrayLessThan4Bytes),
+ libBytes.publicReadBytes4.callAsync(
+ byteArrayLessThan4Bytes,
+ new BigNumber(0)),
constants.LIB_BYTES_GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED,
);
});
it('should return the first 4 bytes of a byte array of arbitrary length', async () => {
- const first4Bytes = await libBytes.publicReadFirst4.callAsync(byteArrayLongerThan32Bytes);
+ const first4Bytes = await libBytes.publicReadBytes4.callAsync(
+ byteArrayLongerThan32Bytes,
+ new BigNumber(0));
const expectedFirst4Bytes = byteArrayLongerThan32Bytes.slice(0, 10);
expect(first4Bytes).to.equal(expectedFirst4Bytes);
});