chain: WIP Generated node sync test
This commit is contained in:
committed by
whyrusleeping
parent
7f5cba1749
commit
a656aea7fe
+1
-1
@@ -40,7 +40,7 @@ func builder(t *testing.T, n int) []api.FullNode {
|
||||
node.FullAPI(&out[i]),
|
||||
node.Online(),
|
||||
node.Repo(repo.NewMemory(nil)),
|
||||
MockHost(mn),
|
||||
node.MockHost(mn),
|
||||
|
||||
genesis,
|
||||
)
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package node_test
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/filecoin-project/go-lotus/node"
|
||||
|
||||
"github.com/filecoin-project/go-lotus/node/modules/lp2p"
|
||||
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
|
||||
)
|
||||
|
||||
func MockHost(mn mocknet.Mocknet) node.Option {
|
||||
return node.Options(
|
||||
node.ApplyIf(func(s *node.Settings) bool { return !s.Online },
|
||||
node.Error(errors.New("MockHost must be specified after Online")),
|
||||
),
|
||||
|
||||
node.Override(new(lp2p.RawHost), lp2p.MockHost),
|
||||
node.Override(new(mocknet.Mocknet), mn),
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package node
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
|
||||
|
||||
"github.com/filecoin-project/go-lotus/node/modules/lp2p"
|
||||
)
|
||||
|
||||
func MockHost(mn mocknet.Mocknet) Option {
|
||||
return Options(
|
||||
ApplyIf(func(s *Settings) bool { return !s.Online },
|
||||
Error(errors.New("MockHost must be specified after Online")),
|
||||
),
|
||||
|
||||
Override(new(lp2p.RawHost), lp2p.MockHost),
|
||||
Override(new(mocknet.Mocknet), mn),
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user