cosmjs-util/packages/stargate/src/encoding.spec.ts
2020-10-27 16:54:31 +01:00

16 lines
492 B
TypeScript

/* eslint-disable @typescript-eslint/naming-convention */
import { getMsgType } from "./encoding";
describe("encoding", () => {
describe("getMsgType", () => {
it("works for known type url", () => {
const msgType = getMsgType("/cosmos.staking.v1beta1.MsgDelegate");
expect(msgType).toEqual("cosmos-sdk/MsgDelegate");
});
it("throws for unknown type url", () => {
expect(() => getMsgType("/xxx.Unknown")).toThrowError(/type url not known/i);
});
});
});