You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
687 B

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