eventbus: plumb contexts (#7337)

* eventbus: plumb contexts

* fix lint
This commit is contained in:
Sam Kleinman
2021-11-30 14:24:11 +00:00
committed by GitHub
parent c9f90953a2
commit 4af2dbd03b
22 changed files with 276 additions and 233 deletions
+5 -5
View File
@@ -56,7 +56,7 @@ func TestApplyBlock(t *testing.T) {
block := sf.MakeBlock(state, 1, new(types.Commit))
blockID := types.BlockID{Hash: block.Hash(), PartSetHeader: block.MakePartSet(testPartSize).Header()}
state, err = blockExec.ApplyBlock(state, blockID, block)
state, err = blockExec.ApplyBlock(ctx, state, blockID, block)
require.Nil(t, err)
// TODO check state and mempool
@@ -111,7 +111,7 @@ func TestBeginBlockValidators(t *testing.T) {
// block for height 2
block := sf.MakeBlock(state, 2, lastCommit)
_, err = sm.ExecCommitBlock(nil, proxyApp.Consensus(), block, log.TestingLogger(), stateStore, 1, state)
_, err = sm.ExecCommitBlock(ctx, nil, proxyApp.Consensus(), block, log.TestingLogger(), stateStore, 1, state)
require.Nil(t, err, tc.desc)
// -> app receives a list of validators with a bool indicating if they signed
@@ -219,7 +219,7 @@ func TestBeginBlockByzantineValidators(t *testing.T) {
block.Header.EvidenceHash = block.Evidence.Hash()
blockID = types.BlockID{Hash: block.Hash(), PartSetHeader: block.MakePartSet(testPartSize).Header()}
_, err = blockExec.ApplyBlock(state, blockID, block)
_, err = blockExec.ApplyBlock(ctx, state, blockID, block)
require.Nil(t, err)
// TODO check state and mempool
@@ -404,7 +404,7 @@ func TestEndBlockValidatorUpdates(t *testing.T) {
{PubKey: pk, Power: 10},
}
state, err = blockExec.ApplyBlock(state, blockID, block)
state, err = blockExec.ApplyBlock(ctx, state, blockID, block)
require.Nil(t, err)
// test new validator was added to NextValidators
if assert.Equal(t, state.Validators.Size()+1, state.NextValidators.Size()) {
@@ -462,7 +462,7 @@ func TestEndBlockValidatorUpdatesResultingInEmptySet(t *testing.T) {
{PubKey: vp, Power: 0},
}
assert.NotPanics(t, func() { state, err = blockExec.ApplyBlock(state, blockID, block) })
assert.NotPanics(t, func() { state, err = blockExec.ApplyBlock(ctx, state, blockID, block) })
assert.NotNil(t, err)
assert.NotEmpty(t, state.NextValidators.Validators)
}