Skip to content
This repository was archived by the owner on May 24, 2022. It is now read-only.
Prev Previous commit
Next Next commit
encodeToken required argument
  • Loading branch information
amaury1093 committed Nov 23, 2018
commit d9475406eb8e03490d9a80b3ecf8158f6d488d80
2 changes: 1 addition & 1 deletion packages/abi/src/encoder/encoder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { padAddress, padFixedBytes, padU32 } from '../util/pad';
describe('encoder/Encoder', () => {
describe('encodeToken', () => {
it('requires token as Token', () => {
expect(() => Encoder.encodeToken(undefined)).toThrow(/Token/);
expect(() => Encoder.encodeToken(undefined as any)).toThrow(/Token/);
});

it('encodes address tokens in Mediate(raw)', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/abi/src/encoder/encoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Encoder {
return `${inits}${closings}`;
}

static encodeToken (token?: Token, index = 0): Mediate {
static encodeToken (token: Token, index = 0): Mediate {
if (!token || !isInstanceOf(token, Token)) {
throw new Error('token should be instanceof Token');
}
Expand Down