cosmjs-util/packages/amino/src/paths.spec.ts
2021-03-24 17:14:57 +01:00

27 lines
732 B
TypeScript

import { Slip10RawIndex } from "@cosmjs/crypto";
import { makeCosmoshubPath } from "./paths";
describe("paths", () => {
describe("makeCosmoshubPath", () => {
it("works", () => {
// m/44'/118'/0'/0/0
expect(makeCosmoshubPath(0)).toEqual([
Slip10RawIndex.hardened(44),
Slip10RawIndex.hardened(118),
Slip10RawIndex.hardened(0),
Slip10RawIndex.normal(0),
Slip10RawIndex.normal(0),
]);
// m/44'/118'/0'/0/123
expect(makeCosmoshubPath(123)).toEqual([
Slip10RawIndex.hardened(44),
Slip10RawIndex.hardened(118),
Slip10RawIndex.hardened(0),
Slip10RawIndex.normal(0),
Slip10RawIndex.normal(123),
]);
});
});
});