Skip to content

Commit

Permalink
Merge pull request #36 from sdaveas/chore/new-account-with-password
Browse files Browse the repository at this point in the history
chore: allow providing password in account creation
  • Loading branch information
Zhangguiguang authored Nov 14, 2024
2 parents 5eea4e9 + 1d67ec9 commit 23a2bc2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion account/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ func NewAccountWithKeystore(keystore string) (*Account, error) {
}

func NewAccountWithMnemonic(mnemonic string) (*Account, error) {
seed, err := bip39.NewSeedWithErrorChecking(mnemonic, "")
return NewAccountWithMnemonicAndPassword(mnemonic, "")
}

func NewAccountWithMnemonicAndPassword(mnemonic string, password string) (*Account, error) {
seed, err := bip39.NewSeedWithErrorChecking(mnemonic, password)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 23a2bc2

Please sign in to comment.