mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-04 15:17:02 +00:00
use request structs for InitChain and BeginBlock
This commit is contained in:
@@ -55,7 +55,7 @@ func (app *ChainAwareApplication) Query(reqQuery types.RequestQuery) (resQuery t
|
||||
}
|
||||
}
|
||||
|
||||
func (app *ChainAwareApplication) BeginBlock(hash []byte, header *types.Header) {
|
||||
func (app *ChainAwareApplication) BeginBlock(reqBeginBlock types.RequestBeginBlock) {
|
||||
app.beginCount++
|
||||
return
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ func TestChainAware(t *testing.T) {
|
||||
hash := []byte("fake block hash")
|
||||
header := &types.Header{}
|
||||
for i := uint64(0); i < n; i++ {
|
||||
client.BeginBlockSync(hash, header)
|
||||
client.BeginBlockSync(&types.RequestBeginBlock{hash, header})
|
||||
client.EndBlockSync(i)
|
||||
client.CommitSync()
|
||||
}
|
||||
|
||||
@@ -106,8 +106,8 @@ func (app *PersistentDummyApplication) Query(reqQuery types.RequestQuery) types.
|
||||
}
|
||||
|
||||
// Save the validators in the merkle tree
|
||||
func (app *PersistentDummyApplication) InitChain(validators []*types.Validator) {
|
||||
for _, v := range validators {
|
||||
func (app *PersistentDummyApplication) InitChain(params types.RequestInitChain) {
|
||||
for _, v := range params.Validators {
|
||||
r := app.updateValidator(v)
|
||||
if r.IsErr() {
|
||||
app.logger.Error("Error updating validators", "r", r)
|
||||
@@ -116,9 +116,9 @@ func (app *PersistentDummyApplication) InitChain(validators []*types.Validator)
|
||||
}
|
||||
|
||||
// Track the block hash and header information
|
||||
func (app *PersistentDummyApplication) BeginBlock(hash []byte, header *types.Header) {
|
||||
func (app *PersistentDummyApplication) BeginBlock(params types.RequestBeginBlock) {
|
||||
// update latest block info
|
||||
app.blockHeader = header
|
||||
app.blockHeader = params.Header
|
||||
|
||||
// reset valset changes
|
||||
app.changes = make([]*types.Validator, 0)
|
||||
|
||||
Reference in New Issue
Block a user