ValidatorSetUpdates -> ValidatorUpdates

This commit is contained in:
Jae Kwon
2017-12-20 00:02:41 -08:00
parent 9a5b943e77
commit c14d3982ac
7 changed files with 663 additions and 669 deletions
+2 -2
View File
@@ -107,7 +107,7 @@ func TestPersistentDummyInfo(t *testing.T) {
}
// add a validator, remove a validator, update a validator
func TestValSetUpdates(t *testing.T) {
func TestValUpdates(t *testing.T) {
dir, err := ioutil.TempDir("/tmp", "abci-dummy-test") // TODO
if err != nil {
t.Fatal(err)
@@ -188,7 +188,7 @@ func makeApplyBlock(t *testing.T, dummy types.Application, heightInt int, diff [
resEndBlock := dummy.EndBlock(types.RequestEndBlock{header.Height})
dummy.Commit()
valsEqual(t, diff, resEndBlock.ValidatorSetUpdates)
valsEqual(t, diff, resEndBlock.ValidatorUpdates)
}
+5 -5
View File
@@ -28,7 +28,7 @@ type PersistentDummyApplication struct {
app *DummyApplication
// validator set
valSetUpdates []*types.Validator
ValUpdates []*types.Validator
logger log.Logger
}
@@ -71,7 +71,7 @@ func (app *PersistentDummyApplication) DeliverTx(tx []byte) types.ResponseDelive
// format is "val:pubkey/power"
if isValidatorTx(tx) {
// update validators in the merkle tree
// and in app.valSetUpdates
// and in app.ValUpdates
return app.execValidatorTx(tx)
}
@@ -119,13 +119,13 @@ func (app *PersistentDummyApplication) InitChain(req types.RequestInitChain) typ
// Track the block hash and header information
func (app *PersistentDummyApplication) BeginBlock(req types.RequestBeginBlock) types.ResponseBeginBlock {
// reset valset changes
app.valSetUpdates = make([]*types.Validator, 0)
app.ValUpdates = make([]*types.Validator, 0)
return types.ResponseBeginBlock{}
}
// Update the validator set
func (app *PersistentDummyApplication) EndBlock(req types.RequestEndBlock) types.ResponseEndBlock {
return types.ResponseEndBlock{ValidatorSetUpdates: app.valSetUpdates}
return types.ResponseEndBlock{ValidatorUpdates: app.ValUpdates}
}
//---------------------------------------------
@@ -216,7 +216,7 @@ func (app *PersistentDummyApplication) updateValidator(v *types.Validator) types
}
// we only update the changes array if we successfully updated the tree
app.valSetUpdates = append(app.valSetUpdates, v)
app.ValUpdates = append(app.ValUpdates, v)
return types.ResponseDeliverTx{Code: code.CodeTypeOK}
}