Cleanup tests
This commit is contained in:
@@ -250,8 +250,14 @@ describe('LibBytes', () => {
|
||||
*/
|
||||
|
||||
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 = libBytes.publicReadFirst4.callAsync(byteArrayLongerThan32Bytes);
|
||||
const first4Bytes = await libBytes.publicReadFirst4.callAsync(byteArrayLongerThan32Bytes);
|
||||
const expectedFirst4Bytes = byteArrayLongerThan32Bytes.slice(0, 10);
|
||||
expect(first4Bytes).to.equal(expectedFirst4Bytes);
|
||||
});
|
||||
|
Reference in New Issue
Block a user