mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-03 18:42:14 +00:00
* p2p: ressurrect the p2p envelope and use to calculate message metric Co-authored-by: Callum Waters <cmwaters19@gmail.com>
26 lines
667 B
Go
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) {}
|