Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request #168 from muXxer/fix/replace-deprecated-call
Browse files Browse the repository at this point in the history
fix: replace deprecated call
  • Loading branch information
marten-seemann authored Aug 14, 2021
2 parents 301af20 + 6139fde commit ca567f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pstoreds/keybook.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (kb *dsKeyBook) PubKey(p peer.ID) ic.PubKey {
log.Errorf("error when extracting pubkey from peer ID for peer %s: %s\n", p.Pretty(), err)
return nil
}
pkb, err := pk.Bytes()
pkb, err := ic.MarshalPublicKey(pk)
if err != nil {
log.Errorf("error when turning extracted pubkey into bytes for peer %s: %s\n", p.Pretty(), err)
return nil
Expand All @@ -75,7 +75,7 @@ func (kb *dsKeyBook) AddPubKey(p peer.ID, pk ic.PubKey) error {
}

key := kbBase.ChildString(base32.RawStdEncoding.EncodeToString([]byte(p))).Child(pubSuffix)
val, err := pk.Bytes()
val, err := ic.MarshalPublicKey(pk)
if err != nil {
log.Errorf("error while converting pubkey byte string for peer %s: %s\n", p.Pretty(), err)
return err
Expand Down Expand Up @@ -111,7 +111,7 @@ func (kb *dsKeyBook) AddPrivKey(p peer.ID, sk ic.PrivKey) error {
}

key := kbBase.ChildString(base32.RawStdEncoding.EncodeToString([]byte(p))).Child(privSuffix)
val, err := sk.Bytes()
val, err := ic.MarshalPrivateKey(sk)
if err != nil {
log.Errorf("error while converting privkey byte string for peer %s: %s\n", p.Pretty(), err)
return err
Expand Down

0 comments on commit ca567f2

Please sign in to comment.