github.com/MagHErmit/tendermint@v0.282.1/p2p/mock/reactor.go (about)

     1  package mock
     2  
     3  import (
     4  	"github.com/MagHErmit/tendermint/libs/log"
     5  	"github.com/MagHErmit/tendermint/p2p"
     6  	"github.com/MagHErmit/tendermint/p2p/conn"
     7  )
     8  
     9  type Reactor struct {
    10  	p2p.BaseReactor
    11  
    12  	Channels []*conn.ChannelDescriptor
    13  }
    14  
    15  func NewReactor() *Reactor {
    16  	r := &Reactor{}
    17  	r.BaseReactor = *p2p.NewBaseReactor("Mock-PEX", r)
    18  	r.SetLogger(log.TestingLogger())
    19  	return r
    20  }
    21  
    22  func (r *Reactor) GetChannels() []*conn.ChannelDescriptor            { return r.Channels }
    23  func (r *Reactor) AddPeer(peer p2p.Peer)                             {}
    24  func (r *Reactor) RemovePeer(peer p2p.Peer, reason interface{})      {}
    25  func (r *Reactor) Receive(chID byte, peer p2p.Peer, msgBytes []byte) {}