Skip to content

Commit

Permalink
Do not use depricated function
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero committed Sep 19, 2024
1 parent 670c667 commit d60a24d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
3 changes: 3 additions & 0 deletions fixtures/ipns_records/generator/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ go 1.22
require (
github.com/ipfs/boxo v0.23.0
github.com/ipfs/go-cid v0.4.1
github.com/ipfs/go-test v0.0.4
github.com/libp2p/go-libp2p v0.36.3
google.golang.org/protobuf v1.34.2
)

require (
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/ipfs/go-block-format v0.2.0 // indirect
github.com/ipfs/go-ipfs-util v0.0.3 // indirect
github.com/ipfs/go-log/v2 v2.5.1 // indirect
github.com/ipld/go-ipld-prime v0.21.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
Expand Down
11 changes: 2 additions & 9 deletions fixtures/ipns_records/generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ import (
"github.com/ipfs/boxo/ipns"
ipns_pb "github.com/ipfs/boxo/ipns/pb"
"github.com/ipfs/boxo/path"
"github.com/ipfs/boxo/util"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-test/random"
ic "github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/peer"
"google.golang.org/protobuf/proto"
)

Expand Down Expand Up @@ -40,13 +39,7 @@ func panicOnErr(err error) {
}

func makeKeyPair() (ic.PrivKey, ic.PubKey, ipns.Name) {
sr := util.NewTimeSeededRand()
sk, pk, err := ic.GenerateKeyPairWithReader(ic.Ed25519, 0, sr)
panicOnErr(err)

pid, err := peer.IDFromPublicKey(pk)
panicOnErr(err)

pid, sk, pk := random.Identity()
return sk, pk, ipns.NameFromPeer(pid)
}

Expand Down

0 comments on commit d60a24d

Please sign in to comment.