diff options
author | Fabio Berger <me@fabioberger.com> | 2018-05-26 06:39:02 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-05-26 06:39:02 +0800 |
commit | 790af0fd72754314025c2c396a785167671f8bb6 (patch) | |
tree | 38a1d2dd86316268f6afcc2e01c4afaf3ee03c49 /packages/contracts/test/libraries | |
parent | 4e5bfae332279acbb58d76a32102b5a27dde069d (diff) | |
parent | c7f5e77b3fe7c1805202a5b1e1e1ce1e9d31a6b0 (diff) | |
download | dexon-sol-tools-790af0fd72754314025c2c396a785167671f8bb6.tar dexon-sol-tools-790af0fd72754314025c2c396a785167671f8bb6.tar.gz dexon-sol-tools-790af0fd72754314025c2c396a785167671f8bb6.tar.bz2 dexon-sol-tools-790af0fd72754314025c2c396a785167671f8bb6.tar.lz dexon-sol-tools-790af0fd72754314025c2c396a785167671f8bb6.tar.xz dexon-sol-tools-790af0fd72754314025c2c396a785167671f8bb6.tar.zst dexon-sol-tools-790af0fd72754314025c2c396a785167671f8bb6.zip |
Merge branch 'v2-prototype' into refactor/order-utils/for-v2
* v2-prototype:
Fix imports in order_utils
Use web3-wrapper instead of 0x.js, update logDecoder
Cleanup tests
Add errMsg when throwing on unrecognized error
Move readFirst4 to LibBytes
Add old MultiSig to previous contracts, cleanup file structure
Fix build
Address feedback, rename contract to AssetProxyOwner
Update multisig tests and utils
Update MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress to use a mapping of registered proxies
Implement design for relayers with no volume or tokens
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); + }); + }); }); |