fix up e2e tests

This commit is contained in:
Callum Waters
2022-09-30 12:30:51 +02:00
parent d1616c192b
commit a2978b4b10
4 changed files with 27 additions and 20 deletions
+7 -7
View File
@@ -570,19 +570,19 @@ func ExecCommitBlock(
logger log.Logger,
store Store,
initialHeight int64,
) error {
_, err := execBlockOnProxyApp(logger, appConnConsensus, block, store, initialHeight)
) ([]byte, error) {
resp, err := execBlockOnProxyApp(logger, appConnConsensus, block, store, initialHeight)
if err != nil {
logger.Error("failed executing block on proxy app", "height", block.Height, "err", err)
return err
return nil, err
}
// Commit block, get hash back
res, err := appConnConsensus.Commit(context.TODO())
_, err = appConnConsensus.Commit(context.TODO())
if err != nil {
logger.Error("client error during proxyAppConn.CommitSync", "err", res)
return err
logger.Error("client error during proxyAppConn.CommitSync", "err", err)
return nil, err
}
return nil
return resp.AgreedAppData, nil
}
+5 -5
View File
@@ -74,8 +74,8 @@ func TestApplyBlock(t *testing.T) {
assert.EqualValues(t, 1, state.Version.Consensus.App, "App version wasn't updated")
}
// TestBeginBlockValidators ensures we send absent validators list.
func TestBeginBlockValidators(t *testing.T) {
// TestFinalizeBlockValidators ensures we send absent validators list.
func TestFinalizeBlockValidators(t *testing.T) {
app := &testApp{}
cc := proxy.NewLocalClientCreator(app)
proxyApp := proxy.NewAppConns(cc, proxy.NopMetrics())
@@ -121,7 +121,7 @@ func TestBeginBlockValidators(t *testing.T) {
// block for height 2
block := makeBlock(state, 2, lastCommit)
err = sm.ExecCommitBlock(proxyApp.Consensus(), block, log.TestingLogger(), stateStore, 1)
_, err = sm.ExecCommitBlock(proxyApp.Consensus(), block, log.TestingLogger(), stateStore, 1)
require.Nil(t, err, tc.desc)
// -> app receives a list of validators with a bool indicating if they signed
@@ -139,8 +139,8 @@ func TestBeginBlockValidators(t *testing.T) {
}
}
// TestBeginBlockByzantineValidators ensures we send byzantine validators list.
func TestBeginBlockByzantineValidators(t *testing.T) {
// TestFinalizeBlockByzantineValidators ensures we send byzantine validators list.
func TestFinalizeBlockByzantineValidators(t *testing.T) {
app := &testApp{}
cc := proxy.NewLocalClientCreator(app)
proxyApp := proxy.NewAppConns(cc, proxy.NopMetrics())