mirror of
https://github.com/tendermint/tendermint.git
synced 2026-07-30 03:52:50 +00:00
Previously, many reactors were initialized with the name "Reactor," which made it difficult to log which reactor was doing what. This changes those reactors' names to something more descriptive.
24 lines
667 B
Go
24 lines
667 B
Go
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("Mock-PEX", 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) {}
|