Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrtenz committed Nov 16, 2022
1 parent ad67125 commit 38306b3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/rpc-methods/src/restricted/getBip32Entropy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,26 @@ describe('getBip32EntropyCaveatSpecifications', () => {
).toBe('foo');
});

it('ignores unknown fields', async () => {
const fn = jest.fn().mockImplementation(() => 'foo');

expect(
await getBip32EntropyCaveatSpecifications[
SnapCaveatType.PermittedDerivationPaths
].decorator(fn, {
type: SnapCaveatType.PermittedDerivationPaths,
value: [params],
// @ts-expect-error Missing other required properties.
})({
params: {
path: ['m', "44'", "60'", "0'", '0', '1'],
curve: 'secp256k1',
compressed: true,
},
}),
).toBe('foo');
});

it('throws if the path is invalid', async () => {
const fn = jest.fn().mockImplementation(() => 'foo');

Expand Down

0 comments on commit 38306b3

Please sign in to comment.