send ValidatorSetUpdates event when validator set changes (#2161)

Refs #1916
This commit is contained in:
Anton Kaliaev
2018-08-14 19:16:35 +04:00
committed by GitHub
parent 0f931eeb10
commit 80e49abada
8 changed files with 202 additions and 109 deletions

View File

@@ -380,6 +380,13 @@ func fireEvents(logger log.Logger, eventBus types.BlockEventPublisher, block *ty
Result: *(abciResponses.DeliverTx[i]),
}})
}
if len(abciResponses.EndBlock.ValidatorUpdates) > 0 {
// if there were an error, we would've stopped in updateValidators
updates, _ := types.PB2TM.Validators(abciResponses.EndBlock.ValidatorUpdates)
eventBus.PublishEventValidatorSetUpdates(
types.EventDataValidatorSetUpdates{ValidatorUpdates: updates})
}
}
//----------------------------------------------------------------------------------------------------