diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-05-25 08:24:52 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-25 08:24:52 +0800 |
commit | 654698b20880398eded74342c8030a6009938103 (patch) | |
tree | 0c206bee801971372866051b08b1710a05eb431a /packages/contracts/test/libraries | |
parent | 895a9093aa5f204f9f7ad0fedb2934a8b6c40b17 (diff) | |
parent | 237ebb07161c46fa85ca778a1c2ff60f63611bd7 (diff) | |
download | dexon-sol-tools-654698b20880398eded74342c8030a6009938103.tar dexon-sol-tools-654698b20880398eded74342c8030a6009938103.tar.gz dexon-sol-tools-654698b20880398eded74342c8030a6009938103.tar.bz2 dexon-sol-tools-654698b20880398eded74342c8030a6009938103.tar.lz dexon-sol-tools-654698b20880398eded74342c8030a6009938103.tar.xz dexon-sol-tools-654698b20880398eded74342c8030a6009938103.tar.zst dexon-sol-tools-654698b20880398eded74342c8030a6009938103.zip |
Merge pull request #571 from 0xProject/feature/contracts/proxyOwner
Update MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress
Diffstat (limited to 'packages/contracts/test/libraries')
-rw-r--r-- | packages/contracts/test/libraries/lib_bytes.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/contracts/test/libraries/lib_bytes.ts b/packages/contracts/test/libraries/lib_bytes.ts index ce3adbdae..968bac300 100644 --- a/packages/contracts/test/libraries/lib_bytes.ts +++ b/packages/contracts/test/libraries/lib_bytes.ts @@ -248,4 +248,18 @@ describe('LibBytes', () => { it('should fail if the length between the offset and end of the byte array is too short to hold a uint256)', async () => {}); }); */ + + describe('readFirst4', () => { + it('should revert if byte array has a length < 4', async () => { + const byteArrayLessThan4Bytes = '0x010101'; + return expect(libBytes.publicReadFirst4.callAsync(byteArrayLessThan4Bytes)).to.be.rejectedWith( + constants.REVERT, + ); + }); + it('should return the first 4 bytes of a byte array of arbitrary length', async () => { + const first4Bytes = await libBytes.publicReadFirst4.callAsync(byteArrayLongerThan32Bytes); + const expectedFirst4Bytes = byteArrayLongerThan32Bytes.slice(0, 10); + expect(first4Bytes).to.equal(expectedFirst4Bytes); + }); + }); }); |