Skip to content

Commit

Permalink
feat: split keystore create and save
Browse files Browse the repository at this point in the history
  • Loading branch information
shrimalmadhur committed Sep 24, 2024
1 parent 14ae38f commit 94bd1b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions keystore/keystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ func NewKeyPair(password string, language mnemonic.Language) (*KeyPair, error) {
}, nil
}

func (k *KeyPair) Save() error {
func (k *KeyPair) Save(path string) error {
// Encrypt the key
ks := &Keystore{}
ks, err := ks.Encrypt(k.PrivateKey, k.Password, DerivationPathBN254, nil, nil)
Expand All @@ -478,7 +478,7 @@ func (k *KeyPair) Save() error {
}

// Save the keystore
err = ks.Save(k.Password)
err = ks.Save(path)
if err != nil {
return err
}
Expand Down

0 comments on commit 94bd1b7

Please sign in to comment.