mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-09 14:43:19 +00:00
types: move NodeInfo from p2p (#6618)
This commit is contained in:
@@ -47,7 +47,7 @@ type Consensus interface {
|
||||
type transport interface {
|
||||
Listeners() []string
|
||||
IsListening() bool
|
||||
NodeInfo() p2p.NodeInfo
|
||||
NodeInfo() types.NodeInfo
|
||||
}
|
||||
|
||||
type peers interface {
|
||||
|
||||
@@ -108,9 +108,9 @@ type ValidatorInfo struct {
|
||||
|
||||
// Node Status
|
||||
type ResultStatus struct {
|
||||
NodeInfo p2p.NodeInfo `json:"node_info"`
|
||||
SyncInfo SyncInfo `json:"sync_info"`
|
||||
ValidatorInfo ValidatorInfo `json:"validator_info"`
|
||||
NodeInfo types.NodeInfo `json:"node_info"`
|
||||
SyncInfo SyncInfo `json:"sync_info"`
|
||||
ValidatorInfo ValidatorInfo `json:"validator_info"`
|
||||
}
|
||||
|
||||
// Is TxIndexing enabled
|
||||
@@ -141,7 +141,7 @@ type ResultDialPeers struct {
|
||||
|
||||
// A peer
|
||||
type Peer struct {
|
||||
NodeInfo p2p.NodeInfo `json:"node_info"`
|
||||
NodeInfo types.NodeInfo `json:"node_info"`
|
||||
IsOutbound bool `json:"is_outbound"`
|
||||
ConnectionStatus p2p.ConnectionStatus `json:"connection_status"`
|
||||
RemoteIP string `json:"remote_ip"`
|
||||
|
||||
@@ -4,8 +4,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/tendermint/tendermint/internal/p2p"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
||||
func TestStatusIndexer(t *testing.T) {
|
||||
@@ -15,17 +14,17 @@ func TestStatusIndexer(t *testing.T) {
|
||||
status = &ResultStatus{}
|
||||
assert.False(t, status.TxIndexEnabled())
|
||||
|
||||
status.NodeInfo = p2p.NodeInfo{}
|
||||
status.NodeInfo = types.NodeInfo{}
|
||||
assert.False(t, status.TxIndexEnabled())
|
||||
|
||||
cases := []struct {
|
||||
expected bool
|
||||
other p2p.NodeInfoOther
|
||||
other types.NodeInfoOther
|
||||
}{
|
||||
{false, p2p.NodeInfoOther{}},
|
||||
{false, p2p.NodeInfoOther{TxIndex: "aa"}},
|
||||
{false, p2p.NodeInfoOther{TxIndex: "off"}},
|
||||
{true, p2p.NodeInfoOther{TxIndex: "on"}},
|
||||
{false, types.NodeInfoOther{}},
|
||||
{false, types.NodeInfoOther{TxIndex: "aa"}},
|
||||
{false, types.NodeInfoOther{TxIndex: "off"}},
|
||||
{true, types.NodeInfoOther{TxIndex: "on"}},
|
||||
}
|
||||
|
||||
for _, tc := range cases {
|
||||
|
||||
Reference in New Issue
Block a user