aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/libraries
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-05-22 22:39:21 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-05-25 06:39:19 +0800
commitd4aacd218a4fdb1876ac656e04fcccdb892a9395 (patch)
tree840ebd2fc7484340c0f426488d550e939ad0fb79 /packages/contracts/test/libraries
parent326a566db29031edf21320923e67dde309573efd (diff)
downloaddexon-sol-tools-d4aacd218a4fdb1876ac656e04fcccdb892a9395.tar
dexon-sol-tools-d4aacd218a4fdb1876ac656e04fcccdb892a9395.tar.gz
dexon-sol-tools-d4aacd218a4fdb1876ac656e04fcccdb892a9395.tar.bz2
dexon-sol-tools-d4aacd218a4fdb1876ac656e04fcccdb892a9395.tar.lz
dexon-sol-tools-d4aacd218a4fdb1876ac656e04fcccdb892a9395.tar.xz
dexon-sol-tools-d4aacd218a4fdb1876ac656e04fcccdb892a9395.tar.zst
dexon-sol-tools-d4aacd218a4fdb1876ac656e04fcccdb892a9395.zip
Move readFirst4 to LibBytes
Diffstat (limited to 'packages/contracts/test/libraries')
-rw-r--r--packages/contracts/test/libraries/lib_bytes.ts8
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);
+ });
+ });
});