amino: Simplify Secp256k1HdWallet serialization

This commit is contained in:
willclarktech 2021-04-20 17:26:10 +02:00
parent 26fea00741
commit b5b15d234b
No known key found for this signature in database
GPG Key ID: 551A86E2E398ADF7

View File

@ -311,12 +311,10 @@ export class Secp256k1HdWallet implements OfflineAminoSigner {
): Promise<string> {
const dataToEncrypt: Secp256k1HdWalletData = {
mnemonic: this.mnemonic,
accounts: this.accounts.map(
(account): DerivationInfoJson => ({
hdPath: pathToString(account.hdPath),
prefix: account.prefix,
}),
),
accounts: this.accounts.map(({ hdPath, prefix }) => ({
hdPath: pathToString(hdPath),
prefix: prefix,
})),
};
const dataToEncryptRaw = toUtf8(JSON.stringify(dataToEncrypt));