mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-01 02:30:39 +08:00
refactor: use core.ConfigOption return type
This commit is contained in:
@ -22,9 +22,7 @@ import (
|
|||||||
|
|
||||||
var log = eventlog.Logger("epictest")
|
var log = eventlog.Logger("epictest")
|
||||||
|
|
||||||
type ConfigOption func(ctx context.Context) (*core.IpfsNode, error)
|
func MocknetTestRepo(p peer.ID, h host.Host, conf testutil.LatencyConfig) core.ConfigOption {
|
||||||
|
|
||||||
func MocknetTestRepo(p peer.ID, h host.Host, conf testutil.LatencyConfig) ConfigOption {
|
|
||||||
return func(ctx context.Context) (*core.IpfsNode, error) {
|
return func(ctx context.Context) (*core.IpfsNode, error) {
|
||||||
const kWriteCacheElems = 100
|
const kWriteCacheElems = 100
|
||||||
const alwaysSendToPeer = true
|
const alwaysSendToPeer = true
|
||||||
@ -43,7 +41,6 @@ func MocknetTestRepo(p peer.ID, h host.Host, conf testutil.LatencyConfig) Config
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return &core.IpfsNode{
|
return &core.IpfsNode{
|
||||||
Peerstore: h.Peerstore(),
|
Peerstore: h.Peerstore(),
|
||||||
Blockstore: bstore,
|
Blockstore: bstore,
|
||||||
|
Reference in New Issue
Block a user