Skip to content

Commit

Permalink
fix(gno.land/pkg/gnoclient): Signer takes chainID
Browse files Browse the repository at this point in the history
  • Loading branch information
albttx committed Jan 24, 2024
1 parent d1ead00 commit da6ba21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion gno.land/pkg/gnoclient/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ func Example_withInMemCrypto() {
bip39Passphrase := ""
account := uint32(0)
index := uint32(0)
signer, _ := gnoclient.SignerFromBip39(mnemo, bip39Passphrase, account, index)
chainID := "dev"
signer, _ := gnoclient.SignerFromBip39(chainID, mnemo, bip39Passphrase, account, index)

remote := "127.0.0.1:26657"
rpcClient := rpcclient.NewHTTP(remote, "/websocket")
Expand Down
3 changes: 2 additions & 1 deletion gno.land/pkg/gnoclient/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ var _ Signer = (*SignerFromKeybase)(nil)
// This can be useful in scenarios where storing private keys in the filesystem isn't feasible.
//
// Warning: Using keys.NewKeyBaseFromDir is recommended where possible, as it is more secure.
func SignerFromBip39(mnemonic string, passphrase string, account uint32, index uint32) (Signer, error) {
func SignerFromBip39(chainID string, mnemonic string, passphrase string, account uint32, index uint32) (Signer, error) {
kb := keys.NewInMemory()
name := "default"
password := "" // Password isn't needed for in-memory storage
Expand All @@ -138,6 +138,7 @@ func SignerFromBip39(mnemonic string, passphrase string, account uint32, index u
Keybase: kb,
Account: name,
Password: password,
ChainID: chainID,
}

return &signer, nil
Expand Down

0 comments on commit da6ba21

Please sign in to comment.