Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore error for vote already exist #1325

Merged
merged 4 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ require (
replace (
github.com/CosmWasm/wasmd => github.com/sei-protocol/sei-wasmd v0.0.4
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0
github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.2.72-hotfix-1
github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.2.74-0.20240206074251-b2a65f839fa6
github.com/cosmos/iavl => github.com/sei-protocol/sei-iavl v0.1.9
github.com/cosmos/ibc-go/v3 => github.com/sei-protocol/sei-ibc-go/v3 v3.3.0
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1170,8 +1170,8 @@ github.com/securego/gosec/v2 v2.11.0/go.mod h1:SX8bptShuG8reGC0XS09+a4H2BoWSJi+f
github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY=
github.com/sei-protocol/goutils v0.0.2 h1:Bfa7Sv+4CVLNM20QcpvGb81B8C5HkQC/kW1CQpIbXDA=
github.com/sei-protocol/goutils v0.0.2/go.mod h1:iYE2DuJfEnM+APPehr2gOUXfuLuPsVxorcDO+Tzq9q8=
github.com/sei-protocol/sei-cosmos v0.2.72-hotfix-1 h1:W4TPXaBrlDYz8ZLJ6d12nyGjJLlOW9CaqmZHSu/i8fg=
github.com/sei-protocol/sei-cosmos v0.2.72-hotfix-1/go.mod h1:CykNPmj90YkwBorkvnc05u9k9MBNDHC3h4CIdmq3R98=
github.com/sei-protocol/sei-cosmos v0.2.74-0.20240206074251-b2a65f839fa6 h1:P4Ufs8Tk1zbtTA0v8f6I92+LyeDCzyuFkSbZ9I75ERI=
github.com/sei-protocol/sei-cosmos v0.2.74-0.20240206074251-b2a65f839fa6/go.mod h1:CykNPmj90YkwBorkvnc05u9k9MBNDHC3h4CIdmq3R98=
github.com/sei-protocol/sei-db v0.0.30 h1:dlAOTE+7nByzzAD9cb1/DxaHWbxXOHFh58a2ImvcoYs=
github.com/sei-protocol/sei-db v0.0.30/go.mod h1:F/ZKZA8HJPcUzSZPA8yt6pfwlGriJ4RDR4eHKSGLStI=
github.com/sei-protocol/sei-iavl v0.1.9 h1:y4mVYftxLNRs6533zl7N0/Ch+CzRQc04JDfHolIxgBE=
Expand Down
3 changes: 2 additions & 1 deletion oracle/price-feeder/oracle/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
simappparams "github.com/cosmos/cosmos-sdk/simapp/params"
"github.com/cosmos/cosmos-sdk/telemetry"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/rs/zerolog"
Expand Down Expand Up @@ -191,7 +192,7 @@ func (oc OracleClient) BroadcastTx(

oc.Logger.Info().Msg(fmt.Sprintf("Sending broadcastTx with account sequence number %d", txf.Sequence()))
resp, err := clientCtx.BroadcastTx(txBytes)
if resp != nil && resp.Code != 0 {
if resp != nil && resp.Code != 0 && resp.Code != sdkerrors.ErrAlreadyExists.ABCICode() {
err = fmt.Errorf("received error response code from broadcast tx: %d", resp.Code)
}
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion x/oracle/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
return err
}
if lastSubmittedHeight, ok := spd.oracleVoteMap[msg.Validator]; ok && lastSubmittedHeight == curHeight {
return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("the validator has already submitted a vote at the current height=%d", curHeight))
return sdkerrors.Wrap(sdkerrors.ErrAlreadyExists, fmt.Sprintf("the validator has already submitted a vote at the current height=%d", curHeight))

Check failure on line 112 in x/oracle/ante.go

View workflow job for this annotation

GitHub Actions / forward-compatibility

undefined: errors.ErrAlreadyExists

Check warning on line 112 in x/oracle/ante.go

View check run for this annotation

Codecov / codecov/patch

x/oracle/ante.go#L112

Added line #L112 was not covered by tests
}

spd.oracleVoteMap[msg.Validator] = curHeight
Expand Down
Loading