mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-30 18:13:54 +08:00
refactor(blockservice) use bitswap.Exchange interface
This commit is contained in:
@ -16,11 +16,11 @@ import (
|
|||||||
// It uses an internal `datastore.Datastore` instance to store values.
|
// It uses an internal `datastore.Datastore` instance to store values.
|
||||||
type BlockService struct {
|
type BlockService struct {
|
||||||
Datastore ds.Datastore
|
Datastore ds.Datastore
|
||||||
Remote *bitswap.BitSwap
|
Remote bitswap.Exchange
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewBlockService creates a BlockService with given datastore instance.
|
// NewBlockService creates a BlockService with given datastore instance.
|
||||||
func NewBlockService(d ds.Datastore, rem *bitswap.BitSwap) (*BlockService, error) {
|
func NewBlockService(d ds.Datastore, rem bitswap.Exchange) (*BlockService, error) {
|
||||||
if d == nil {
|
if d == nil {
|
||||||
return nil, fmt.Errorf("BlockService requires valid datastore")
|
return nil, fmt.Errorf("BlockService requires valid datastore")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user