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

fix: case unauthorized message #11229

Merged
merged 12 commits into from
Feb 24, 2022
7 changes: 7 additions & 0 deletions client/broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ func (ctx Context) BroadcastTxCommit(txBytes []byte) (*sdk.TxResponse, error) {
return sdk.NewResponseFormatBroadcastTxCommit(res), nil
}

// with these changes(https://github.com/tendermint/tendermint/pull/7683)
// in the terndermint, CLI is breaking (for few transactions ex: executing unathorized messages in feegrant)
amaury1093 marked this conversation as resolved.
Show resolved Hide resolved
// this check is added to tackle the particular case.
if strings.Contains(err.Error(), "transaction encountered error") {
return sdk.NewResponseFormatBroadcastTxCommit(res), nil
}

if errRes := CheckTendermintError(err, txBytes); errRes != nil {
return errRes, nil
}
Expand Down
38 changes: 17 additions & 21 deletions x/feegrant/client/testutil/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -912,28 +912,24 @@ func (s *IntegrationTestSuite) TestFilteredFeeAllowance() {
&sdk.TxResponse{},
2,
},
/* TODO(#10559): This case times out after TM v0.35.
Figure out why and fix it.

{
"should fail with unauthorized msgs",
func() (testutil.BufferWriter, error) {
args := append(
[]string{
grantee.String(),
"cosmos14cm33pvnrv2497tyt8sp9yavhmw83nwej3m0e8",
fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, "100stake"),
fmt.Sprintf("--%s=%s", flags.FlagFeeGranter, granter),
},
commonFlags...,
)
cmd := cli.NewCmdFeeGrant()
return clitestutil.ExecTestCLICmd(clientCtx, cmd, args)
{
"should fail with unauthorized msgs",
func() (testutil.BufferWriter, error) {
args := append(
[]string{
grantee.String(),
"cosmos14cm33pvnrv2497tyt8sp9yavhmw83nwej3m0e8",
fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, "100stake"),
fmt.Sprintf("--%s=%s", flags.FlagFeeGranter, granter),
},
&sdk.TxResponse{},
7,
},
*/
commonFlags...,
)
cmd := cli.NewCmdFeeGrant()
return clitestutil.ExecTestCLICmd(clientCtx, cmd, args)
},
&sdk.TxResponse{},
7,
},
}

for _, tc := range cases {
Expand Down