Skip to content

Commit

Permalink
blockservice: stop using deprecated NewWriteThrough in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorropo committed Jan 15, 2024
1 parent 02c77b4 commit b8ac21b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions blockservice/blockservice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestWriteThroughWorks(t *testing.T) {
}
exchbstore := blockstore.NewBlockstore(dssync.MutexWrap(ds.NewMapDatastore()))
exch := offline.Exchange(exchbstore)
bserv := NewWriteThrough(bstore, exch)
bserv := New(bstore, exch, WriteThrough())
bgen := butil.NewBlockGenerator()

block := bgen.Next()
Expand Down Expand Up @@ -62,7 +62,7 @@ func TestExchangeWrite(t *testing.T) {
offline.Exchange(exchbstore),
0,
}
bserv := NewWriteThrough(bstore, exch)
bserv := New(bstore, exch, WriteThrough())
bgen := butil.NewBlockGenerator()

for name, fetcher := range map[string]BlockGetter{
Expand Down Expand Up @@ -136,7 +136,7 @@ func TestLazySessionInitialization(t *testing.T) {
session := offline.Exchange(bstore2)
exch := offline.Exchange(bstore3)
sessionExch := &fakeSessionExchange{Interface: exch, session: session}
bservSessEx := NewWriteThrough(bstore, sessionExch)
bservSessEx := New(bstore, sessionExch, WriteThrough())
bgen := butil.NewBlockGenerator()

block := bgen.Next()
Expand Down Expand Up @@ -234,7 +234,7 @@ func TestNilExchange(t *testing.T) {
block := bgen.Next()

bs := blockstore.NewBlockstore(dssync.MutexWrap(ds.NewMapDatastore()))
bserv := NewWriteThrough(bs, nil)
bserv := New(bs, nil, WriteThrough())
sess := NewSession(ctx, bserv)
_, err := sess.GetBlock(ctx, block.Cid())
if !ipld.IsNotFound(err) {
Expand Down

0 comments on commit b8ac21b

Please sign in to comment.