mirror of
https://github.com/fluencelabs/tendermint
synced 2025-07-31 04:01:55 +00:00
node: allow registration of custom reactors while creating node (#3771)
* change invocation of NewNode across * custom reactor name are prefixed with CUSTOM_ * upgate changelog pending * improve comments * node: refactor NewNode to use functional options
This commit is contained in:
23
p2p/mock/reactor.go
Normal file
23
p2p/mock/reactor.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package mock
|
||||
|
||||
import (
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
"github.com/tendermint/tendermint/p2p"
|
||||
"github.com/tendermint/tendermint/p2p/conn"
|
||||
)
|
||||
|
||||
type Reactor struct {
|
||||
p2p.BaseReactor
|
||||
}
|
||||
|
||||
func NewReactor() *Reactor {
|
||||
r := &Reactor{}
|
||||
r.BaseReactor = *p2p.NewBaseReactor("Reactor", r)
|
||||
r.SetLogger(log.TestingLogger())
|
||||
return r
|
||||
}
|
||||
|
||||
func (r *Reactor) GetChannels() []*conn.ChannelDescriptor { return []*conn.ChannelDescriptor{} }
|
||||
func (r *Reactor) AddPeer(peer p2p.Peer) {}
|
||||
func (r *Reactor) RemovePeer(peer p2p.Peer, reason interface{}) {}
|
||||
func (r *Reactor) Receive(chID byte, peer p2p.Peer, msgBytes []byte) {}
|
Reference in New Issue
Block a user