Skip to content

Commit

Permalink
test: improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
b00ste committed Jul 24, 2023
1 parent f7c9e5e commit aef4985
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/lib/encoder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,20 @@ describe('encoder', () => {
assert.throws(() => encodeValueType('uint128', 'helloWorld'));
});

it('throws when trying to encode a bytes17 as `uint128`', () => {
it('throws when trying to encode a bytes17 as `uint128`', () => {
assert.throws(() =>
encodeValueType('uint128', '340282366920938463463374607431768211456'),
);
assert.throws(() =>
encodeValueType('uint128', '0x0100000000000000000000000000000000'),
);
});

it('throws when trying to decode a bytes17 as `uint128`', () => {
assert.throws(() =>
it('throws when trying to decode a bytes17 as `uint128`', () => {
expect(() =>
decodeValueType('uint128', '0x000000000000000000000000000000ffff'),
).to.throw(
"Can't convert hex value 0x000000000000000000000000000000ffff to uint128. Too many bytes. 17 > 16",
);
});

Expand Down

0 comments on commit aef4985

Please sign in to comment.