Skip to content

Commit 7e56ff0

Browse files
authored
Update packages/amino/src/secp256k1hdwallet.ts
1 parent da58476 commit 7e56ff0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/amino/src/secp256k1hdwallet.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ export class Secp256k1HdWallet implements OfflineAminoSigner {
198198
): Promise<Secp256k1HdWallet> {
199199
const root = JSON.parse(serialization);
200200
if (!isNonNullObject(root)) throw new Error("Root document is not an object.");
201+
// This cast is safe because `root` comes from a valid JSON document and `root` is a non-null object.
202+
// I.e. it can only be a JSON object, not an aribitrary JS object.
201203
const untypedRoot: Record<string, any> = root;
202204
switch (untypedRoot.type) {
203205
case serializationTypeV1: {

0 commit comments

Comments
 (0)