fix remaining tests

This commit is contained in:
William Banfield
2022-03-18 16:15:14 -04:00
parent 72c141d310
commit 678be2a987
3 changed files with 11 additions and 3 deletions

View File

@@ -66,7 +66,7 @@ func (r ResponseProcessProposal) IsAccepted() bool {
}
func (r ResponseProcessProposal) IsStatusUnknown() bool {
return r.Status == ResponseProcessProposal_ACCEPT
return r.Status == ResponseProcessProposal_UNKNOWN
}
// IsUnknown returns true if Code is Unknown

View File

@@ -12,6 +12,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/abci/example/kvstore"
abci "github.com/tendermint/tendermint/abci/types"
abcitypes "github.com/tendermint/tendermint/abci/types"
abcimocks "github.com/tendermint/tendermint/abci/types/mocks"
"github.com/tendermint/tendermint/crypto/tmhash"
@@ -1940,7 +1941,11 @@ func TestProcessProposalAccept(t *testing.T) {
defer cancel()
m := abcimocks.NewBaseMock()
m.On("ProcessProposal", mock.Anything).Return(abcitypes.ResponseProcessProposal{Accept: testCase.accept})
status := abci.ResponseProcessProposal_REJECT
if testCase.accept {
status = abci.ResponseProcessProposal_ACCEPT
}
m.On("ProcessProposal", mock.Anything).Return(abcitypes.ResponseProcessProposal{Status: status})
cs1, _ := makeState(ctx, t, makeStateArgs{config: config, application: m})
height, round := cs1.Height, cs1.Round
@@ -1990,7 +1995,7 @@ func TestFinalizeBlockCalled(t *testing.T) {
m := abcimocks.NewBaseMock()
m.On("ProcessProposal", mock.Anything).Return(abcitypes.ResponseProcessProposal{Status: abci.ResponseProcessProposal_ACCEPT})
m.On("VerifyVoteExtension", mock.Anything).Return(abcitypes.ResponseVerifyVoteExtension{
Result: abcitypes.ResponseVerifyVoteExtension_ACCEPT,
Status: abcitypes.ResponseVerifyVoteExtension_ACCEPT,
})
m.On("FinalizeBlock", mock.Anything).Return(abcitypes.ResponseFinalizeBlock{}).Maybe()
cs1, vss := makeState(ctx, t, makeStateArgs{config: config, application: m})

View File

@@ -615,6 +615,9 @@ func TestEmptyPrepareProposal(t *testing.T) {
require.NoError(t, eventBus.Start(ctx))
app := abcimocks.NewBaseMock()
app.On("PrepareProposal", mock.Anything).Return(abci.ResponsePrepareProposal{
ModifiedTxStatus: abci.ResponsePrepareProposal_UNMODIFIED,
}, nil)
cc := abciclient.NewLocalClient(logger, app)
proxyApp := proxy.New(cc, logger, proxy.NopMetrics())
err := proxyApp.Start(ctx)