Skip to content

Commit

Permalink
Optimize AnteHandle method to skip checks if disabledMsgs is empty (#504
Browse files Browse the repository at this point in the history
)

* Optimize AnteHandle method to skip checks if disabledMsgs is empty

* Problem: cometbft not up to date (#505)

include the fix from cometbft/cometbft#3196

* Problem: disable of create vesting account messages are not complete (#506)

* Problem: disable of create vesting account messages are not complete

* Update CHANGELOG.md

Signed-off-by: mmsqe <[email protected]>

---------

Signed-off-by: mmsqe <[email protected]>

* CHANGELOG

* Update CHANGELOG.md

Signed-off-by: mmsqe <[email protected]>

---------

Signed-off-by: mmsqe <[email protected]>
Signed-off-by: fx0x55 <[email protected]>
Co-authored-by: mmsqe <[email protected]>
Co-authored-by: mmsqe <[email protected]>
  • Loading branch information
3 people authored Aug 2, 2024
1 parent b0022ea commit ff4caa1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* [#496](https://github.com/crypto-org-chain/cronos/pull/496) Set mempool MaxTx from config.
* (ante) [#497](https://github.com/crypto-org-chain/ethermint/pull/497) Enforce positive value check in eth transaction.
* (deps) [#505](https://github.com/crypto-org-chain/ethermint/pull/505) Update cometbft to v0.38.10.
* (ante) [#504](https://github.com/crypto-org-chain/ethermint/pull/504) Optimize AnteHandle method to skip checks if disabledMsgs is empty.

## v0.21.x-cronos

Expand Down
4 changes: 4 additions & 0 deletions app/ante/authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ func NewAuthzLimiterDecorator(disabledMsgTypes []string) AuthzLimiterDecorator {
}

func (ald AuthzLimiterDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) {
if len(ald.disabledMsgs) == 0 {
return next(ctx, tx, simulate)
}

if err := ald.checkDisabledMsgs(tx.GetMsgs(), false, 0); err != nil {
return ctx, errorsmod.Wrapf(errortypes.ErrUnauthorized, err.Error())
}
Expand Down

0 comments on commit ff4caa1

Please sign in to comment.