diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-06-13 06:29:18 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-06-13 06:30:46 +0800 |
commit | 0917fa0d75b7328c156af2ffafa641ae09286e2e (patch) | |
tree | 6caa5f5dfb2029a4285baa69a9f6eb2250675b94 /packages/contracts/test/libraries | |
parent | cfb73dd53417895fbc2fadfae29412b4288a63ef (diff) | |
download | dexon-0x-contracts-0917fa0d75b7328c156af2ffafa641ae09286e2e.tar.gz dexon-0x-contracts-0917fa0d75b7328c156af2ffafa641ae09286e2e.tar.zst dexon-0x-contracts-0917fa0d75b7328c156af2ffafa641ae09286e2e.zip |
Rename popByte and popAddress
Diffstat (limited to 'packages/contracts/test/libraries')
-rw-r--r-- | packages/contracts/test/libraries/lib_bytes.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/contracts/test/libraries/lib_bytes.ts b/packages/contracts/test/libraries/lib_bytes.ts index 25e75a505..a31a4789c 100644 --- a/packages/contracts/test/libraries/lib_bytes.ts +++ b/packages/contracts/test/libraries/lib_bytes.ts @@ -91,15 +91,15 @@ describe('LibBytes', () => { await blockchainLifecycle.revertAsync(); }); - describe('popByte', () => { + describe('popLastByte', () => { it('should revert if length is 0', async () => { return expectRevertOrOtherErrorAsync( - libBytes.publicPopByte.callAsync(constants.NULL_BYTES), + libBytes.publicPopLastByte.callAsync(constants.NULL_BYTES), constants.LIB_BYTES_GREATER_THAN_ZERO_LENGTH_REQUIRED, ); }); it('should pop the last byte from the input and return it', async () => { - const [newBytes, poppedByte] = await libBytes.publicPopByte.callAsync(byteArrayLongerThan32Bytes); + const [newBytes, poppedByte] = await libBytes.publicPopLastByte.callAsync(byteArrayLongerThan32Bytes); const expectedNewBytes = byteArrayLongerThan32Bytes.slice(0, -2); const expectedPoppedByte = `0x${byteArrayLongerThan32Bytes.slice(-2)}`; expect(newBytes).to.equal(expectedNewBytes); @@ -107,15 +107,15 @@ describe('LibBytes', () => { }); }); - describe('popAddress', () => { + describe('popLast20Bytes', () => { it('should revert if length is less than 20', async () => { return expectRevertOrOtherErrorAsync( - libBytes.publicPopAddress.callAsync(byteArrayShorterThan20Bytes), + libBytes.publicPopLast20Bytes.callAsync(byteArrayShorterThan20Bytes), constants.LIB_BYTES_GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED, ); }); it('should pop the last 20 bytes from the input and return it', async () => { - const [newBytes, poppedAddress] = await libBytes.publicPopAddress.callAsync(byteArrayLongerThan32Bytes); + const [newBytes, poppedAddress] = await libBytes.publicPopLast20Bytes.callAsync(byteArrayLongerThan32Bytes); const expectedNewBytes = byteArrayLongerThan32Bytes.slice(0, -40); const expectedPoppedAddress = `0x${byteArrayLongerThan32Bytes.slice(-40)}`; expect(newBytes).to.equal(expectedNewBytes); |