Commit f4bab574 authored by tavit ohanian's avatar tavit ohanian

refactor after forking multiformats

parent e2ca9248
......@@ -9,12 +9,12 @@ import (
"io"
"sync"
blocks "github.com/ipfs/go-block-format"
cid "github.com/ipfs/go-cid"
blockstore "github.com/ipfs/go-ipfs-blockstore"
exchange "github.com/ipfs/go-ipfs-exchange-interface"
logging "github.com/ipfs/go-log"
"github.com/ipfs/go-verifcid"
blocks "gitlab.dms3.io/dms3/go-block-format"
cid "gitlab.dms3.io/dms3/go-cid"
blockstore "gitlab.dms3.io/dms3/go-dms3-blockstore"
exchange "gitlab.dms3.io/dms3/go-dms3-exchange-interface"
logging "gitlab.dms3.io/dms3/go-log"
"gitlab.dms3.io/dms3/go-verifcid"
)
var log = logging.Logger("blockservice")
......@@ -147,7 +147,7 @@ func (s *blockService) AddBlock(o blocks.Block) error {
return err
}
log.Event(context.TODO(), "BlockService.BlockAdded", c)
log.Debugf("BlockService.BlockAdded %s", c)
if s.exchange != nil {
if err := s.exchange.HasBlock(o); err != nil {
......@@ -193,7 +193,7 @@ func (s *blockService) AddBlocks(bs []blocks.Block) error {
if s.exchange != nil {
for _, o := range toput {
log.Event(context.TODO(), "BlockService.BlockAdded", o.Cid())
log.Debugf("BlockService.BlockAdded %s", o.Cid())
if err := s.exchange.HasBlock(o); err != nil {
log.Errorf("HasBlock: %s", err.Error())
}
......@@ -243,7 +243,7 @@ func getBlock(ctx context.Context, c cid.Cid, bs blockstore.Blockstore, fget fun
}
return nil, err
}
log.Event(ctx, "BlockService.BlockFetched", c)
log.Debugf("BlockService.BlockFetched %s", c)
return blk, nil
}
......@@ -320,7 +320,7 @@ func getBlocks(ctx context.Context, ks []cid.Cid, bs blockstore.Blockstore, fget
}
for b := range rblocks {
log.Event(ctx, "BlockService.BlockFetched", b.Cid())
log.Debugf("BlockService.BlockFetched %s", b.Cid())
select {
case out <- b:
case <-ctx.Done():
......@@ -335,7 +335,7 @@ func getBlocks(ctx context.Context, ks []cid.Cid, bs blockstore.Blockstore, fget
func (s *blockService) DeleteBlock(c cid.Cid) error {
err := s.blockstore.DeleteBlock(c)
if err == nil {
log.Event(context.TODO(), "BlockService.BlockDeleted", c)
log.Debugf("BlockService.BlockDeleted %s", c)
}
return err
}
......
......@@ -4,13 +4,13 @@ import (
"context"
"testing"
blocks "github.com/ipfs/go-block-format"
ds "github.com/ipfs/go-datastore"
dssync "github.com/ipfs/go-datastore/sync"
blockstore "github.com/ipfs/go-ipfs-blockstore"
butil "github.com/ipfs/go-ipfs-blocksutil"
exchange "github.com/ipfs/go-ipfs-exchange-interface"
offline "github.com/ipfs/go-ipfs-exchange-offline"
blocks "gitlab.dms3.io/dms3/go-block-format"
ds "gitlab.dms3.io/dms3/go-datastore"
dssync "gitlab.dms3.io/dms3/go-datastore/sync"
blockstore "gitlab.dms3.io/dms3/go-dms3-blockstore"
butil "gitlab.dms3.io/dms3/go-dms3-blocksutil"
exchange "gitlab.dms3.io/dms3/go-dms3-exchange-interface"
offline "gitlab.dms3.io/dms3/go-dms3-exchange-offline"
)
func TestWriteThroughWorks(t *testing.T) {
......
This diff is collapsed.
......@@ -7,15 +7,15 @@ import (
"testing"
"time"
. "github.com/ipfs/go-blockservice"
. "gitlab.dms3.io/dms3/go-blockservice"
blocks "github.com/ipfs/go-block-format"
cid "github.com/ipfs/go-cid"
ds "github.com/ipfs/go-datastore"
dssync "github.com/ipfs/go-datastore/sync"
blockstore "github.com/ipfs/go-ipfs-blockstore"
offline "github.com/ipfs/go-ipfs-exchange-offline"
u "github.com/ipfs/go-ipfs-util"
blocks "gitlab.dms3.io/dms3/go-block-format"
cid "gitlab.dms3.io/dms3/go-cid"
ds "gitlab.dms3.io/dms3/go-datastore"
dssync "gitlab.dms3.io/dms3/go-datastore/sync"
blockstore "gitlab.dms3.io/dms3/go-dms3-blockstore"
offline "gitlab.dms3.io/dms3/go-dms3-exchange-offline"
u "gitlab.dms3.io/dms3/go-dms3-util"
)
func newObject(data []byte) blocks.Block {
......
package bstest
import (
. "github.com/ipfs/go-blockservice"
. "gitlab.dms3.io/dms3/go-blockservice"
testinstance "github.com/ipfs/go-bitswap/testinstance"
tn "github.com/ipfs/go-bitswap/testnet"
delay "github.com/ipfs/go-ipfs-delay"
mockrouting "github.com/ipfs/go-ipfs-routing/mock"
testinstance "gitlab.dms3.io/dms3/go-bitswap/testinstance"
tn "gitlab.dms3.io/dms3/go-bitswap/testnet"
delay "gitlab.dms3.io/dms3/go-dms3-delay"
mockrouting "gitlab.dms3.io/dms3/go-dms3-routing/mock"
)
// Mocks returns |n| connected mock Blockservices
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment