Skip to content

Commit

Permalink
refactor: switch deprecated code to go-test/random
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel committed Aug 5, 2024
1 parent 1034bbe commit 9e69bb7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions core/coreunix/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import (
bstore "github.com/ipfs/boxo/blockstore"
chunker "github.com/ipfs/boxo/chunker"
offline "github.com/ipfs/boxo/exchange/offline"
u "github.com/ipfs/boxo/util"
cid "github.com/ipfs/go-cid"
ds "github.com/ipfs/go-datastore"
dssync "github.com/ipfs/go-datastore/sync"
ipld "github.com/ipfs/go-ipld-format"
"github.com/ipfs/go-test/random"
)

func getDagserv(t *testing.T) ipld.DAGService {
Expand All @@ -35,7 +35,7 @@ func TestMetadata(t *testing.T) {
// Make some random node
ds := getDagserv(t)
data := make([]byte, 1000)
_, err := io.ReadFull(u.NewTimeSeededRand(), data)
_, err := io.ReadFull(random.NewRand(), data)
if err != nil {
t.Fatal(err)
}
Expand Down
4 changes: 2 additions & 2 deletions fuse/ipns/ipns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
coreapi "github.com/ipfs/kubo/core/coreapi"

fstest "bazil.org/fuse/fs/fstestutil"
u "github.com/ipfs/boxo/util"
racedet "github.com/ipfs/go-detect-race"
"github.com/ipfs/go-test/random"
ci "github.com/libp2p/go-libp2p-testing/ci"
)

Expand All @@ -32,7 +32,7 @@ func maybeSkipFuseTests(t *testing.T) {

func randBytes(size int) []byte {
b := make([]byte, size)
_, err := io.ReadFull(u.NewTimeSeededRand(), b)
_, err := io.ReadFull(random.NewRand(), b)
if err != nil {
panic(err)
}
Expand Down
4 changes: 2 additions & 2 deletions fuse/readonly/ipfs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
importer "github.com/ipfs/boxo/ipld/unixfs/importer"
uio "github.com/ipfs/boxo/ipld/unixfs/io"
"github.com/ipfs/boxo/path"
u "github.com/ipfs/boxo/util"
ipld "github.com/ipfs/go-ipld-format"
"github.com/ipfs/go-test/random"
ci "github.com/libp2p/go-libp2p-testing/ci"
)

Expand All @@ -42,7 +42,7 @@ func maybeSkipFuseTests(t *testing.T) {

func randObj(t *testing.T, nd *core.IpfsNode, size int64) (ipld.Node, []byte) {
buf := make([]byte, size)
_, err := io.ReadFull(u.NewTimeSeededRand(), buf)
_, err := io.ReadFull(random.NewRand(), buf)
if err != nil {
t.Fatal(err)
}
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ require (
github.com/ipfs/go-log/v2 v2.5.1
github.com/ipfs/go-metrics-interface v0.0.1
github.com/ipfs/go-metrics-prometheus v0.0.2
github.com/ipfs/go-test v0.0.4
github.com/ipfs/go-unixfsnode v1.9.0
github.com/ipld/go-car v0.6.2
github.com/ipld/go-car/v2 v2.13.1
Expand Down

0 comments on commit 9e69bb7

Please sign in to comment.