Files
tendermint/p2p/mock/reactor.go
William Banfield 09b8708314 p2p: add a per-message type send and receive metric (#9622)
* p2p: ressurrect the p2p envelope and use to calculate message metric

Co-authored-by: Callum Waters <cmwaters19@gmail.com>
2022-10-27 15:46:15 -04:00

26 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
Channels []*conn.ChannelDescriptor
}
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 r.Channels }
func (r *Reactor) AddPeer(peer p2p.Peer) {}
func (r *Reactor) RemovePeer(peer p2p.Peer, reason interface{}) {}
func (r *Reactor) Receive(e p2p.Envelope) {}