mirror of
https://github.com/ipfs/kubo.git
synced 2025-09-10 22:49:13 +08:00
blockservice.New doesnt need to return an error
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
@ -31,10 +31,7 @@ func getMockDagServ(t testing.TB) (mdag.DAGService, pin.ManualPinner) {
|
||||
dstore := ds.NewMapDatastore()
|
||||
tsds := sync.MutexWrap(dstore)
|
||||
bstore := blockstore.NewBlockstore(tsds)
|
||||
bserv, err := bs.New(bstore, offline.Exchange(bstore))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
bserv := bs.New(bstore, offline.Exchange(bstore))
|
||||
dserv := mdag.NewDAGService(bserv)
|
||||
return dserv, pin.NewPinner(tsds, dserv).GetManual()
|
||||
}
|
||||
@ -43,10 +40,7 @@ func getMockDagServAndBstore(t testing.TB) (mdag.DAGService, blockstore.Blocksto
|
||||
dstore := ds.NewMapDatastore()
|
||||
tsds := sync.MutexWrap(dstore)
|
||||
bstore := blockstore.NewBlockstore(tsds)
|
||||
bserv, err := bs.New(bstore, offline.Exchange(bstore))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
bserv := bs.New(bstore, offline.Exchange(bstore))
|
||||
dserv := mdag.NewDAGService(bserv)
|
||||
return dserv, bstore, pin.NewPinner(tsds, dserv).GetManual()
|
||||
}
|
||||
|
Reference in New Issue
Block a user