Skip to content

Commit

Permalink
fix(gno.land/pkg/gnoclient): Signer takes chainID (#1580)
Browse files Browse the repository at this point in the history
  • Loading branch information
albttx authored Jan 25, 2024
1 parent b78fc65 commit 87179b9
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(mnemo, chainID, 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(mnemonic string, chainID 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 87179b9

Please sign in to comment.