lotus/node/testopts.go
Jakub Sztandera 1bf713cb0a
Cleanup imports after rename
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2019-10-18 13:47:41 +09:00

21 lines
420 B
Go

package node
import (
"errors"
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
"github.com/filecoin-project/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),
)
}