mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-08 14:21:14 +00:00
## NOTE: this pr exclusively runs commands from the makefile found here This PR ONLY runs `make format` ... then `make mockery` Its purpose is to ensure that the review scope of other PR's, which changed .go files and thus triggered the linter that only runs conditionally, have smaller review scopes, and should be merged before: https://github.com/tendermint/tendermint/pull/9738 https://github.com/tendermint/tendermint/pull/9739 https://github.com/tendermint/tendermint/pull/9742 --- #### PR checklist - [x] Tests written/updated, or no tests needed - [x] `CHANGELOG_PENDING.md` updated, or no changelog entry needed - [x] Updated relevant documentation (`docs/`) and code comments, or no documentation updates needed
42 lines
1.3 KiB
Go
42 lines
1.3 KiB
Go
package p2p
|
|
|
|
import (
|
|
"github.com/cosmos/gogoproto/proto"
|
|
|
|
"github.com/tendermint/tendermint/p2p/conn"
|
|
tmp2p "github.com/tendermint/tendermint/proto/tendermint/p2p"
|
|
)
|
|
|
|
type ChannelDescriptor = conn.ChannelDescriptor
|
|
type ConnectionStatus = conn.ConnectionStatus
|
|
|
|
// Envelope contains a message with sender routing info.
|
|
type Envelope struct {
|
|
Src Peer // sender (empty if outbound)
|
|
Message proto.Message // message payload
|
|
ChannelID byte
|
|
}
|
|
|
|
// Unwrapper is a Protobuf message that can contain a variety of inner messages
|
|
// (e.g. via oneof fields). If a Channel's message type implements Unwrapper, the
|
|
// p2p layer will automatically unwrap inbound messages so that reactors do not have to do this themselves.
|
|
type Unwrapper interface {
|
|
proto.Message
|
|
|
|
// Unwrap will unwrap the inner message contained in this message.
|
|
Unwrap() (proto.Message, error)
|
|
}
|
|
|
|
// Wrapper is a companion type to Unwrapper. It is a Protobuf message that can contain a variety of inner messages. The p2p layer will automatically wrap outbound messages so that the reactors do not have to do it themselves.
|
|
type Wrapper interface {
|
|
proto.Message
|
|
|
|
// Wrap will take the underlying message and wrap it in its wrapper type.
|
|
Wrap() proto.Message
|
|
}
|
|
|
|
var (
|
|
_ Wrapper = &tmp2p.PexRequest{}
|
|
_ Wrapper = &tmp2p.PexAddrs{}
|
|
)
|