diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-05-22 22:39:21 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-05-25 06:39:19 +0800 |
commit | d4aacd218a4fdb1876ac656e04fcccdb892a9395 (patch) | |
tree | 840ebd2fc7484340c0f426488d550e939ad0fb79 /packages/contracts/test/libraries/lib_bytes.ts | |
parent | 326a566db29031edf21320923e67dde309573efd (diff) | |
download | dexon-sol-tools-d4aacd218a4fdb1876ac656e04fcccdb892a9395.tar.gz dexon-sol-tools-d4aacd218a4fdb1876ac656e04fcccdb892a9395.tar.zst dexon-sol-tools-d4aacd218a4fdb1876ac656e04fcccdb892a9395.zip |
Move readFirst4 to LibBytes
Diffstat (limited to 'packages/contracts/test/libraries/lib_bytes.ts')
-rw-r--r-- | packages/contracts/test/libraries/lib_bytes.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/contracts/test/libraries/lib_bytes.ts b/packages/contracts/test/libraries/lib_bytes.ts index ce3adbdae..fc28c363b 100644 --- a/packages/contracts/test/libraries/lib_bytes.ts +++ b/packages/contracts/test/libraries/lib_bytes.ts @@ -248,4 +248,12 @@ 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 return the first 4 bytes of a byte array of arbitrary length', async () => { + const first4Bytes = libBytes.publicReadFirst4.callAsync(byteArrayLongerThan32Bytes); + const expectedFirst4Bytes = byteArrayLongerThan32Bytes.slice(0, 10); + expect(first4Bytes).to.equal(expectedFirst4Bytes); + }); + }); }); |