mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-26 15:22:15 +00:00
s/*EventDataRoundState/EventDataRoundState/g
This commit is contained in:
parent
26d64208d1
commit
8a3bba48e3
@ -235,7 +235,7 @@ func (conR *ConsensusReactor) SetEventSwitch(evsw *events.EventSwitch) {
|
|||||||
func (conR *ConsensusReactor) registerEventCallbacks() {
|
func (conR *ConsensusReactor) registerEventCallbacks() {
|
||||||
|
|
||||||
conR.evsw.AddListenerForEvent("conR", types.EventStringNewRoundStep(), func(data events.EventData) {
|
conR.evsw.AddListenerForEvent("conR", types.EventStringNewRoundStep(), func(data events.EventData) {
|
||||||
rs := data.(*types.EventDataRoundState).RoundState.(*RoundState)
|
rs := data.(types.EventDataRoundState).RoundState.(*RoundState)
|
||||||
conR.broadcastNewRoundStep(rs)
|
conR.broadcastNewRoundStep(rs)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -97,8 +97,8 @@ type RoundState struct {
|
|||||||
LastValidators *types.ValidatorSet
|
LastValidators *types.ValidatorSet
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rs *RoundState) RoundStateEvent() *types.EventDataRoundState {
|
func (rs *RoundState) RoundStateEvent() types.EventDataRoundState {
|
||||||
edrs := &types.EventDataRoundState{
|
edrs := types.EventDataRoundState{
|
||||||
Height: rs.Height,
|
Height: rs.Height,
|
||||||
Round: rs.Round,
|
Round: rs.Round,
|
||||||
Step: rs.Step.String(),
|
Step: rs.Step.String(),
|
||||||
|
@ -243,7 +243,7 @@ func TestFullRound1(t *testing.T) {
|
|||||||
|
|
||||||
// grab proposal
|
// grab proposal
|
||||||
re := <-propCh
|
re := <-propCh
|
||||||
propBlockHash := re.(*types.EventDataRoundState).RoundState.(*RoundState).ProposalBlock.Hash()
|
propBlockHash := re.(types.EventDataRoundState).RoundState.(*RoundState).ProposalBlock.Hash()
|
||||||
|
|
||||||
<-voteCh // wait for prevote
|
<-voteCh // wait for prevote
|
||||||
validatePrevote(t, cs, round, vss[0], propBlockHash)
|
validatePrevote(t, cs, round, vss[0], propBlockHash)
|
||||||
@ -336,7 +336,7 @@ func TestLockNoPOL(t *testing.T) {
|
|||||||
cs1.startRoutines(0)
|
cs1.startRoutines(0)
|
||||||
|
|
||||||
re := <-proposalCh
|
re := <-proposalCh
|
||||||
rs := re.(*types.EventDataRoundState).RoundState.(*RoundState)
|
rs := re.(types.EventDataRoundState).RoundState.(*RoundState)
|
||||||
theBlockHash := rs.ProposalBlock.Hash()
|
theBlockHash := rs.ProposalBlock.Hash()
|
||||||
|
|
||||||
<-voteCh // prevote
|
<-voteCh // prevote
|
||||||
@ -376,7 +376,7 @@ func TestLockNoPOL(t *testing.T) {
|
|||||||
|
|
||||||
// now we're on a new round and not the proposer, so wait for timeout
|
// now we're on a new round and not the proposer, so wait for timeout
|
||||||
re = <-timeoutProposeCh
|
re = <-timeoutProposeCh
|
||||||
rs = re.(*types.EventDataRoundState).RoundState.(*RoundState)
|
rs = re.(types.EventDataRoundState).RoundState.(*RoundState)
|
||||||
|
|
||||||
if rs.ProposalBlock != nil {
|
if rs.ProposalBlock != nil {
|
||||||
t.Fatal("Expected proposal block to be nil")
|
t.Fatal("Expected proposal block to be nil")
|
||||||
@ -420,7 +420,7 @@ func TestLockNoPOL(t *testing.T) {
|
|||||||
incrementRound(cs2)
|
incrementRound(cs2)
|
||||||
|
|
||||||
re = <-proposalCh
|
re = <-proposalCh
|
||||||
rs = re.(*types.EventDataRoundState).RoundState.(*RoundState)
|
rs = re.(types.EventDataRoundState).RoundState.(*RoundState)
|
||||||
|
|
||||||
// now we're on a new round and are the proposer
|
// now we're on a new round and are the proposer
|
||||||
if !bytes.Equal(rs.ProposalBlock.Hash(), rs.LockedBlock.Hash()) {
|
if !bytes.Equal(rs.ProposalBlock.Hash(), rs.LockedBlock.Hash()) {
|
||||||
@ -505,7 +505,7 @@ func TestLockPOLRelock(t *testing.T) {
|
|||||||
|
|
||||||
<-newRoundCh
|
<-newRoundCh
|
||||||
re := <-proposalCh
|
re := <-proposalCh
|
||||||
rs := re.(*types.EventDataRoundState).RoundState.(*RoundState)
|
rs := re.(types.EventDataRoundState).RoundState.(*RoundState)
|
||||||
theBlockHash := rs.ProposalBlock.Hash()
|
theBlockHash := rs.ProposalBlock.Hash()
|
||||||
|
|
||||||
<-voteCh // prevote
|
<-voteCh // prevote
|
||||||
@ -576,7 +576,7 @@ func TestLockPOLRelock(t *testing.T) {
|
|||||||
be := <-newBlockCh
|
be := <-newBlockCh
|
||||||
b := be.(types.EventDataNewBlock)
|
b := be.(types.EventDataNewBlock)
|
||||||
re = <-newRoundCh
|
re = <-newRoundCh
|
||||||
rs = re.(*types.EventDataRoundState).RoundState.(*RoundState)
|
rs = re.(types.EventDataRoundState).RoundState.(*RoundState)
|
||||||
if rs.Height != 2 {
|
if rs.Height != 2 {
|
||||||
t.Fatal("Expected height to increment")
|
t.Fatal("Expected height to increment")
|
||||||
}
|
}
|
||||||
@ -610,7 +610,7 @@ func TestLockPOLUnlock(t *testing.T) {
|
|||||||
startTestRound(cs1, cs1.Height, 0)
|
startTestRound(cs1, cs1.Height, 0)
|
||||||
<-newRoundCh
|
<-newRoundCh
|
||||||
re := <-proposalCh
|
re := <-proposalCh
|
||||||
rs := re.(*types.EventDataRoundState).RoundState.(*RoundState)
|
rs := re.(types.EventDataRoundState).RoundState.(*RoundState)
|
||||||
theBlockHash := rs.ProposalBlock.Hash()
|
theBlockHash := rs.ProposalBlock.Hash()
|
||||||
|
|
||||||
<-voteCh // prevote
|
<-voteCh // prevote
|
||||||
@ -634,7 +634,7 @@ func TestLockPOLUnlock(t *testing.T) {
|
|||||||
|
|
||||||
// timeout to new round
|
// timeout to new round
|
||||||
re = <-timeoutWaitCh
|
re = <-timeoutWaitCh
|
||||||
rs = re.(*types.EventDataRoundState).RoundState.(*RoundState)
|
rs = re.(types.EventDataRoundState).RoundState.(*RoundState)
|
||||||
lockedBlockHash := rs.LockedBlock.Hash()
|
lockedBlockHash := rs.LockedBlock.Hash()
|
||||||
|
|
||||||
//XXX: this isnt gauranteed to get there before the timeoutPropose ...
|
//XXX: this isnt gauranteed to get there before the timeoutPropose ...
|
||||||
@ -692,7 +692,7 @@ func TestLockPOLSafety1(t *testing.T) {
|
|||||||
startTestRound(cs1, cs1.Height, 0)
|
startTestRound(cs1, cs1.Height, 0)
|
||||||
<-newRoundCh
|
<-newRoundCh
|
||||||
re := <-proposalCh
|
re := <-proposalCh
|
||||||
rs := re.(*types.EventDataRoundState).RoundState.(*RoundState)
|
rs := re.(types.EventDataRoundState).RoundState.(*RoundState)
|
||||||
propBlock := rs.ProposalBlock
|
propBlock := rs.ProposalBlock
|
||||||
|
|
||||||
<-voteCh // prevote
|
<-voteCh // prevote
|
||||||
@ -740,7 +740,7 @@ func TestLockPOLSafety1(t *testing.T) {
|
|||||||
re = <-proposalCh
|
re = <-proposalCh
|
||||||
}
|
}
|
||||||
|
|
||||||
rs = re.(*types.EventDataRoundState).RoundState.(*RoundState)
|
rs = re.(types.EventDataRoundState).RoundState.(*RoundState)
|
||||||
|
|
||||||
if rs.LockedBlock != nil {
|
if rs.LockedBlock != nil {
|
||||||
t.Fatal("we should not be locked!")
|
t.Fatal("we should not be locked!")
|
||||||
@ -903,7 +903,7 @@ func TestSlashingPrevotes(t *testing.T) {
|
|||||||
re := <-proposalCh
|
re := <-proposalCh
|
||||||
<-voteCh // prevote
|
<-voteCh // prevote
|
||||||
|
|
||||||
rs := re.(*types.EventDataRoundState).RoundState.(*RoundState)
|
rs := re.(types.EventDataRoundState).RoundState.(*RoundState)
|
||||||
|
|
||||||
// we should now be stuck in limbo forever, waiting for more prevotes
|
// we should now be stuck in limbo forever, waiting for more prevotes
|
||||||
// add one for a different block should cause us to go into prevote wait
|
// add one for a different block should cause us to go into prevote wait
|
||||||
@ -981,7 +981,7 @@ func TestHalt1(t *testing.T) {
|
|||||||
startTestRound(cs1, cs1.Height, 0)
|
startTestRound(cs1, cs1.Height, 0)
|
||||||
<-newRoundCh
|
<-newRoundCh
|
||||||
re := <-proposalCh
|
re := <-proposalCh
|
||||||
rs := re.(*types.EventDataRoundState).RoundState.(*RoundState)
|
rs := re.(types.EventDataRoundState).RoundState.(*RoundState)
|
||||||
propBlock := rs.ProposalBlock
|
propBlock := rs.ProposalBlock
|
||||||
propBlockParts := propBlock.MakePartSet()
|
propBlockParts := propBlock.MakePartSet()
|
||||||
|
|
||||||
@ -1004,7 +1004,7 @@ func TestHalt1(t *testing.T) {
|
|||||||
// timeout to new round
|
// timeout to new round
|
||||||
<-timeoutWaitCh
|
<-timeoutWaitCh
|
||||||
re = <-newRoundCh
|
re = <-newRoundCh
|
||||||
rs = re.(*types.EventDataRoundState).RoundState.(*RoundState)
|
rs = re.(types.EventDataRoundState).RoundState.(*RoundState)
|
||||||
|
|
||||||
log.Notice("### ONTO ROUND 1")
|
log.Notice("### ONTO ROUND 1")
|
||||||
/*Round2
|
/*Round2
|
||||||
@ -1022,7 +1022,7 @@ func TestHalt1(t *testing.T) {
|
|||||||
// receiving that precommit should take us straight to commit
|
// receiving that precommit should take us straight to commit
|
||||||
<-newBlockCh
|
<-newBlockCh
|
||||||
re = <-newRoundCh
|
re = <-newRoundCh
|
||||||
rs = re.(*types.EventDataRoundState).RoundState.(*RoundState)
|
rs = re.(types.EventDataRoundState).RoundState.(*RoundState)
|
||||||
|
|
||||||
if rs.Height != 2 {
|
if rs.Height != 2 {
|
||||||
t.Fatal("expected height to increment")
|
t.Fatal("expected height to increment")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user