mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-30 05:01:44 +00:00
premerge2: rpc -> rpc/tendermint
This commit is contained in:
@ -1,26 +0,0 @@
|
||||
package core
|
||||
|
||||
import (
|
||||
"github.com/tendermint/go-wire"
|
||||
cm "github.com/tendermint/tendermint/consensus"
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
||||
func Validators() (*ctypes.ResultValidators, error) {
|
||||
blockHeight, validators := consensusState.GetValidators()
|
||||
return &ctypes.ResultValidators{blockHeight, validators}, nil
|
||||
}
|
||||
|
||||
func DumpConsensusState() (*ctypes.ResultDumpConsensusState, error) {
|
||||
roundState := consensusState.GetRoundState()
|
||||
peerRoundStates := []string{}
|
||||
for _, peer := range p2pSwitch.Peers().List() {
|
||||
// TODO: clean this up?
|
||||
peerState := peer.Data.Get(types.PeerStateKey).(*cm.PeerState)
|
||||
peerRoundState := peerState.GetRoundState()
|
||||
peerRoundStateStr := peer.Key + ":" + string(wire.JSONBytes(peerRoundState))
|
||||
peerRoundStates = append(peerRoundStates, peerRoundStateStr)
|
||||
}
|
||||
return &ctypes.ResultDumpConsensusState{roundState.String(), peerRoundStates}, nil
|
||||
}
|
Reference in New Issue
Block a user