diff --git a/x/oracle/abci/proposal.go b/x/oracle/abci/proposal.go index cc999926..9af3ffca 100644 --- a/x/oracle/abci/proposal.go +++ b/x/oracle/abci/proposal.go @@ -54,7 +54,7 @@ func (h *ProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHandler { err := baseapp.ValidateVoteExtensions(ctx, h.stakingKeeper, req.Height, ctx.ChainID(), req.LocalLastCommit) if err != nil { - return nil, err + return &cometabci.ResponsePrepareProposal{Txs: make([][]byte, 0)}, err } if req.Txs == nil { @@ -63,7 +63,7 @@ func (h *ProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHandler { "height", req.Height, err.Error(), ) - return nil, err + return &cometabci.ResponsePrepareProposal{Txs: make([][]byte, 0)}, err } proposalTxs := req.Txs @@ -72,7 +72,7 @@ func (h *ProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHandler { if voteExtensionsEnabled { exchangeRateVotes, err := h.generateExchangeRateVotes(ctx, req.LocalLastCommit) if err != nil { - return nil, err + return &cometabci.ResponsePrepareProposal{Txs: make([][]byte, 0)}, err } injectedVoteExtTx := AggregateExchangeRateVotes{ @@ -85,7 +85,7 @@ func (h *ProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHandler { bz, err := json.Marshal(injectedVoteExtTx) if err != nil { h.logger.Error("failed to encode injected vote extension tx", "err", err) - return nil, oracletypes.ErrEncodeInjVoteExt + return &cometabci.ResponsePrepareProposal{Txs: make([][]byte, 0)}, oracletypes.ErrEncodeInjVoteExt } // Inject a placeholder tx into the proposal s.t. validators can decode, verify, @@ -122,7 +122,7 @@ func (h *ProposalHandler) ProcessProposalHandler() sdk.ProcessProposalHandler { "height", req.Height, err.Error(), ) - return nil, err + return &cometabci.ResponseProcessProposal{Status: cometabci.ResponseProcessProposal_REJECT}, err } voteExtensionsEnabled := VoteExtensionsEnabled(ctx) @@ -130,7 +130,7 @@ func (h *ProposalHandler) ProcessProposalHandler() sdk.ProcessProposalHandler { var injectedVoteExtTx AggregateExchangeRateVotes if err := json.Unmarshal(req.Txs[0], &injectedVoteExtTx); err != nil { h.logger.Error("failed to decode injected vote extension tx", "err", err) - return &cometabci.ResponseProcessProposal{Status: cometabci.ResponseProcessProposal_REJECT}, nil + return &cometabci.ResponseProcessProposal{Status: cometabci.ResponseProcessProposal_REJECT}, err } err := baseapp.ValidateVoteExtensions( ctx, @@ -140,7 +140,7 @@ func (h *ProposalHandler) ProcessProposalHandler() sdk.ProcessProposalHandler { injectedVoteExtTx.ExtendedCommitInfo, ) if err != nil { - return nil, err + return &cometabci.ResponseProcessProposal{Status: cometabci.ResponseProcessProposal_REJECT}, err } // Verify the proposer's oracle exchange rate votes by computing the same diff --git a/x/oracle/abci/voteextension.go b/x/oracle/abci/voteextension.go index 57f5e92b..096c50e2 100644 --- a/x/oracle/abci/voteextension.go +++ b/x/oracle/abci/voteextension.go @@ -62,7 +62,7 @@ func (h *VoteExtensionHandler) ExtendVoteHandler() sdk.ExtendVoteHandler { if h.oracleKeeper.PriceFeeder.Oracle == nil { err := fmt.Errorf("price feeder oracle not set") h.logger.Error(err.Error()) - return nil, err + return &cometabci.ResponseExtendVote{VoteExtension: []byte{}}, err } prices := h.oracleKeeper.PriceFeeder.Oracle.GetPrices() exchangeRatesStr := oracle.GenerateExchangeRatesString(prices) @@ -75,7 +75,7 @@ func (h *VoteExtensionHandler) ExtendVoteHandler() sdk.ExtendVoteHandler { "height", req.Height, err.Error(), ) - return nil, err + return &cometabci.ResponseExtendVote{VoteExtension: []byte{}}, err } // Filter out rates which aren't included in the AcceptList. @@ -99,7 +99,7 @@ func (h *VoteExtensionHandler) ExtendVoteHandler() sdk.ExtendVoteHandler { "height", req.Height, err.Error(), ) - return nil, err + return &cometabci.ResponseExtendVote{VoteExtension: []byte{}}, err } h.logger.Info( "created vote extension",