Skip to content

Commit

Permalink
Remove blockstore.GetBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSisley committed Mar 10, 2022
1 parent 74b92d7 commit b2d1841
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 27 deletions.
2 changes: 1 addition & 1 deletion api/http/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func (s *Server) getBlock(w http.ResponseWriter, r *http.Request) {
c = cid.NewCidV1(cid.Raw, hash)
}

block, err := s.db.GetBlock(ctx, c)
block, err := s.db.Blockstore().Get(ctx, c)
if err != nil {
result.Errors = []interface{}{err.Error()}

Expand Down
3 changes: 0 additions & 3 deletions client/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import (
"github.com/sourcenetwork/defradb/document"
"github.com/sourcenetwork/defradb/document/key"

blocks "github.com/ipfs/go-block-format"
cid "github.com/ipfs/go-cid"
ds "github.com/ipfs/go-datastore"
blockstore "github.com/ipfs/go-ipfs-blockstore"
)
Expand All @@ -35,7 +33,6 @@ type DB interface {

Root() ds.Batching
Blockstore() blockstore.Blockstore
GetBlock(ctx context.Context, c cid.Cid) (blocks.Block, error)

NewTxn(context.Context, bool) (Txn, error)
ExecQuery(context.Context, string) *QueryResult
Expand Down
22 changes: 0 additions & 22 deletions db/blockstore.go

This file was deleted.

2 changes: 1 addition & 1 deletion net/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (p *Peer) handleBroadcastLoop() {
func (p *Peer) RegisterNewDocument(ctx context.Context, dockey key.DocKey, c cid.Cid, schemaID string) error {
log.Debug(p.ctx, "Registering a new document for our peer node", logging.NewKV("DocKey", dockey.String()))

block, err := p.db.GetBlock(ctx, c)
block, err := p.db.Blockstore().Get(ctx, c)
if err != nil {
log.ErrorE(p.ctx, "Failed to get document cid", err)
return err
Expand Down

0 comments on commit b2d1841

Please sign in to comment.