Skip to content

proto-signing serialize() error #1429

Closed

Description

I have a small problem on the use of DirectSecp256k1HdWallet from the lib @cosmjs/proto-signing 0.30.1
When I want to encode a mnenomic with the serialize() function I have an error on the lib libsodium:

TypeError: libsodium_wrappers_1.default.crypto_pwhash is not a function

Here is a simple script to reproduce the error:

import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"

const password = '420420420'
const wallet = await DirectSecp256k1HdWallet.generate(12)
const original = await DirectSecp256k1HdWallet.fromMnemonic(wallet.mnemonic, { 
  prefix: 'bcna',
});     
const serialized = await original.serialize(password);

console.log(wallet.mnemonic)
console.log(serialized)

Result:
image

Tested on:

Node.js v18.16.0
Node.js v16.15.0

Reproduct:

git clone https://gist.github.com/atmoner/16d00040cef99f4f6b30392aa92e454c bug-serialize
cd  bug-serialize
npm i

Run:

node app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions