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

chore: sdk v46 #786

Merged
merged 140 commits into from
Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
5871749
sdk v46
faddat Jul 17, 2022
34be40a
app.go work
faddat Jul 17, 2022
d67cc0b
additional 46 conversion work. mainly gov and math.
faddat Jul 17, 2022
3b0287e
hooks and schedule.go
faddat Jul 17, 2022
d3cd109
fixes for dev env
faddat Jul 17, 2022
344b7eb
generate protos
faddat Jul 17, 2022
fe73cac
fix test
GNaD13 Jul 18, 2022
a2a5c23
Revert "generate protos"
faddat Jul 18, 2022
1ce35d7
change multiply calculate from Int * Int to Dec * Dec
GNaD13 Jul 18, 2022
eca42b0
Merge pull request #70 from notional-labs/devD
nghuyenthevinh2000 Jul 18, 2022
2f53086
Merge branch 'main' into sdk-46
faddat Jul 18, 2022
edda751
fix signers type to mapping
GNaD13 Jul 19, 2022
a7c04db
fix logic test claim TestClaimOfDecayed
GNaD13 Jul 19, 2022
82fa823
Merge branch 'sdk-46' of https://github.com/notional-labs/evmos into …
faddat Jul 19, 2022
eeb5cb7
tidy
faddat Jul 19, 2022
b44d17e
fixes (params_test.go)
faddat Jul 19, 2022
306a0fc
fix genaccounts.go
faddat Jul 19, 2022
f8c489e
fix testnet.go
faddat Jul 19, 2022
a319e02
sdk.Int -> math.Int
faddat Jul 19, 2022
73adb1c
fix logic claim_test
GNaD13 Jul 19, 2022
a166f81
fix more tests
faddat Jul 19, 2022
703e50d
remove gov SetHook
GNaD13 Jul 19, 2022
9d0ea41
Merge branch 'sdk-46' into dang/fix-sdk46-test
GNaD13 Jul 19, 2022
0b96211
Merge pull request #72 from notional-labs/dang/fix-sdk46-test
nghuyenthevinh2000 Jul 19, 2022
da4e396
fix imports
faddat Jul 19, 2022
b1abda5
fix integration test
faddat Jul 19, 2022
33c3cb8
Merge branch 'main' into sdk-46
faddat Jul 20, 2022
84ae61b
evmos v7 ibc-go v5
faddat Jul 20, 2022
9b6af49
Merge branch 'sdk-46' of https://github.com/notional-labs/evmos into …
faddat Jul 20, 2022
eafec9b
import cosmossdk math
GNaD13 Jul 20, 2022
5a39ef6
add NextVals to TestChain
GNaD13 Jul 20, 2022
c1e9f3e
lint
faddat Jul 20, 2022
b81c348
linter passes: use nolint for deprecated gov prop techniques
faddat Jul 20, 2022
4511a13
fix test x/vesting
GNaD13 Jul 20, 2022
8977188
Merge branch 'sdk-46' into dang/fix-sdk46-test
GNaD13 Jul 20, 2022
26e6d91
sdk.Int -> math.Int
GNaD13 Jul 20, 2022
44d5e6d
updated ethermint
faddat Jul 20, 2022
d97dcaa
various fixes for tests
faddat Jul 20, 2022
22d7b15
Merge branch 'sdk-46' of https://github.com/notional-labs/evmos into …
GNaD13 Jul 20, 2022
d946da0
fix valset is nil
nghuyenthevinh2000 Jul 20, 2022
ad398b9
Merge remote-tracking branch 'origin/sdk-46' into dang/fix-sdk46-test
GNaD13 Jul 20, 2022
a74469a
add validator to setup test
GNaD13 Jul 20, 2022
f719c94
revert validator
GNaD13 Jul 20, 2022
7cbe834
Merge pull request #73 from notional-labs/dang/fix-sdk46-test
nghuyenthevinh2000 Jul 20, 2022
225ce03
format, regenerate protos
faddat Jul 20, 2022
c0f9f1c
fumpt
faddat Jul 20, 2022
f184643
fix invariant error in TestOnAcknowledgementPacketIBC
nghuyenthevinh2000 Jul 20, 2022
289e4e7
Merge branch 'sdk-46' of github.com:notional-labs/evmos into sdk-46
nghuyenthevinh2000 Jul 20, 2022
039d786
remove redundant third_party
nghuyenthevinh2000 Jul 20, 2022
759a24d
fix error DeliverTx performEthTx integration_test
GNaD13 Jul 21, 2022
cda0e2b
add validator to Test Keeper erc20
GNaD13 Jul 21, 2022
f81b715
add mock
GNaD13 Jul 21, 2022
3c75756
Merge branch 'main' into sdk-46
faddat Jul 21, 2022
8ce6c57
Merge remote-tracking branch 'upstream/main' into sdk-46
faddat Jul 21, 2022
392623f
Merge remote-tracking branch 'origin/sdk-46' into dang/fix-sdk46-test
GNaD13 Jul 22, 2022
b560590
fix test x/erc20 bonded pool balance is different from bonded coins
GNaD13 Jul 22, 2022
b9f1bd4
newer ibc-go v5 module
faddat Jul 22, 2022
0e8f9dc
apply the valset patch
faddat Jul 22, 2022
3363603
fix test erc20 integration_test => Should init eth account in app.go
GNaD13 Jul 22, 2022
6a0abe2
protos...
faddat Jul 22, 2022
9b792c0
add tools
faddat Jul 22, 2022
1cf159f
bond denom
faddat Jul 22, 2022
7782684
Merge branch 'main' into sdk-46
faddat Jul 22, 2022
e0e40dc
replace all acoin with aevmos
faddat Jul 22, 2022
fa31e69
Merge branch 'sdk-46' of https://github.com/notional-labs/evmos into …
faddat Jul 22, 2022
f86fb20
Merge branch 'main' into sdk-46
faddat Jul 22, 2022
4961131
fix Case_no-op:_error_Ack
GNaD13 Jul 26, 2022
e3942c2
Merge pull request #74 from notional-labs/dang/fix-sdk46-test
nghuyenthevinh2000 Jul 26, 2022
b7312d1
fix bonded pool balances not equal bonded coin
GNaD13 Jul 27, 2022
dfbbb75
Merge pull request #76 from notional-labs/dang/fix-sdk46-test
nghuyenthevinh2000 Jul 27, 2022
06386ef
msgEth from =
GNaD13 Jul 27, 2022
030051e
fix calculate fee
GNaD13 Jul 27, 2022
b76b266
fix vesting test
GNaD13 Jul 28, 2022
d98c13f
remove debug log
GNaD13 Jul 28, 2022
27d8787
change TruncateInt to RoundInt
GNaD13 Jul 28, 2022
7cff71f
fix golangci-lint
GNaD13 Jul 28, 2022
8c674d6
Merge pull request #77 from notional-labs/dang/fix-sdk46-test
nghuyenthevinh2000 Jul 28, 2022
43da117
merge from evmos main
nghuyenthevinh2000 Jul 30, 2022
7c0a47e
fix test ibc callback recovery module
GNaD13 Jul 31, 2022
34d7441
Merge branch 'sdk-46' into testmerge
GNaD13 Jul 31, 2022
0c7294f
revert denom aevmos to acoin
GNaD13 Jul 31, 2022
e200963
Merge pull request #80 from notional-labs/dang/fix-sdk46-test
nghuyenthevinh2000 Jul 31, 2022
c937b0e
Merge branch 'main' into sdk-46
faddat Aug 1, 2022
a194e2f
Merge remote-tracking branch 'origin/main' into sdk-46
faddat Aug 7, 2022
647a3fc
add correct dependencies version
nghuyenthevinh2000 Aug 9, 2022
9fe64bb
merge from main
nghuyenthevinh2000 Aug 10, 2022
da2259d
change ibcante in handler_options.go
nghuyenthevinh2000 Aug 10, 2022
2dab8f8
Merge branch 'main' into sdk-46
nghuyenthevinh2000 Aug 12, 2022
0188341
Merge branch 'main' into sdk-46
nghuyenthevinh2000 Aug 13, 2022
287bdff
Update Makefile
faddat Aug 13, 2022
5d63572
add proto lint tool to gitpod image
faddat Aug 13, 2022
66d3bb8
update genproto
faddat Aug 13, 2022
399b85a
update golangci and Makefile
faddat Aug 13, 2022
91c0451
proto tools
faddat Aug 13, 2022
af95e2b
update scripts and .gitpod.yml
faddat Aug 13, 2022
c3df2b1
gitpod
faddat Aug 13, 2022
b1abcbf
gitpod
faddat Aug 13, 2022
c82f6d2
remove cosmos-proto
faddat Aug 14, 2022
88c07f9
Merge branch 'main' into sdk-46
faddat Aug 14, 2022
c35135d
minor go mod
nghuyenthevinh2000 Aug 15, 2022
dade181
fix proto lint
nghuyenthevinh2000 Aug 15, 2022
32e1d88
restore original protogen
nghuyenthevinh2000 Aug 15, 2022
7aded4a
fix some bash, tidy
faddat Aug 15, 2022
2abdc22
fix some bash
faddat Aug 15, 2022
3fc93f2
bash and ++ instead of += 1
faddat Aug 15, 2022
51d4668
cleanup
faddat Aug 15, 2022
9065cf7
gofumpt
faddat Aug 15, 2022
0966a5c
fix hooks.go issue
faddat Aug 15, 2022
36cdc1b
.golangci.yml
faddat Aug 15, 2022
c38d6f0
merge from main
nghuyenthevinh2000 Aug 19, 2022
060ed6b
minor fix in testutil network
nghuyenthevinh2000 Aug 19, 2022
910c2bd
Update cmd/evmosd/cmd_test.go
nghuyenthevinh2000 Aug 19, 2022
5dbc8cc
Update cmd/evmosd/main.go
nghuyenthevinh2000 Aug 19, 2022
2588d30
Update cmd/evmosd/root.go
nghuyenthevinh2000 Aug 19, 2022
bc22992
Merge branch 'main' into sdk-46
nghuyenthevinh2000 Aug 19, 2022
d9f4886
add implementation for ICS4 GetAppVarsion
nghuyenthevinh2000 Aug 22, 2022
9e8f807
Merge branch 'sdk-46' of github.com:notional-labs/evmos into sdk-46
nghuyenthevinh2000 Aug 22, 2022
56bf48b
minor
nghuyenthevinh2000 Aug 22, 2022
a08dad8
Update x/erc20/client/cli/tx.go
nghuyenthevinh2000 Aug 22, 2022
c5516f5
Update x/erc20/client/cli/tx.go
nghuyenthevinh2000 Aug 22, 2022
f82070b
Update x/erc20/client/cli/tx.go
nghuyenthevinh2000 Aug 22, 2022
4b9e0ab
minor refactor
nghuyenthevinh2000 Aug 22, 2022
a6d4726
Merge branch 'sdk-46' of github.com:notional-labs/evmos into sdk-46
nghuyenthevinh2000 Aug 22, 2022
9fad689
Merge branch 'main' into sdk-46
faddat Aug 24, 2022
2878730
update path to v10 and bump deps
faddat Aug 25, 2022
957aa4d
Update ibc/testing/README.md
faddat Aug 25, 2022
d953572
Update evm_hooks.go
faddat Aug 25, 2022
5d038bb
GetParamSetIfExists
faddat Aug 25, 2022
62aa7b2
Update handler_options.go
faddat Aug 25, 2022
5deca4e
Update root.go
faddat Aug 25, 2022
693f9df
fix shellcheck feedback
faddat Aug 25, 2022
7d16672
comment on GetAppVersion
faddat Aug 25, 2022
45cd327
use ethermint's power reduction
faddat Aug 25, 2022
a9a2931
note need to update ethermint import in go.mod
faddat Aug 25, 2022
c729fa1
use cosmossdk.io/errors
faddat Aug 26, 2022
453a194
Merge branch 'main' into sdk-46
faddat Aug 26, 2022
e3a0f60
minor hygiene
nghuyenthevinh2000 Aug 28, 2022
5941b63
add NewExtensionOptionsDecorator
nghuyenthevinh2000 Aug 30, 2022
271d42e
Merge branch 'main' into sdk-46
GNaD13 Sep 6, 2022
b4d5aa9
merge from main
nghuyenthevinh2000 Sep 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ image: ghcr.io/notional-labs/cosmos

tasks:
- name: install tools
command:
command: |
go install golang.org/x/tools/cmd/goimports@latest
go install mvdan.cc/gofumpt@latest
sudo pacman -Syyu clang --noconfirm
sudo make tools
sudo bash scripts/proto-tools-installer.sh

15 changes: 7 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ linters:
- errcheck
- goconst
- gocritic
- gofmt
- goimports
- gofumpt
- revive
- gosec
- gosimple
Expand Down Expand Up @@ -76,9 +75,9 @@ linters-settings:
gomodguard:
blocked:
versions: # List of blocked module version constraints
- https://github.com/etcd-io/etcd: # Blocked module with version constraint
version: ">= 3.4.10 || ~3.3.23" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons
reason: "CVE-2020-15114; CVE-2020-15136; CVE-2020-15115" # Reason why the version constraint exists. (Optional)
- https://github.com/dgrijalva/jwt-go: # Blocked module with version constraint
version: ">= 4.0.0-preview1" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons
reason: "CVE-2020-26160" # Reason why the version constraint exists. (Optional)
- https://github.com/etcd-io/etcd: # Blocked module with version constraint
version: ">= 3.4.10 || ~3.3.23" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons
reason: "CVE-2020-15114; CVE-2020-15136; CVE-2020-15115" # Reason why the version constraint exists. (Optional)
- https://github.com/dgrijalva/jwt-go: # Blocked module with version constraint
version: ">= 4.0.0-preview1" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons
reason: "CVE-2020-26160" # Reason why the version constraint exists. (Optional)
16 changes: 7 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -436,16 +436,15 @@ lint-fix-contracts:
.PHONY: lint lint-fix

format:
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -name '*.pb.go' | xargs gofmt -w -s
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -name '*.pb.go' | xargs misspell -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -name '*.pb.go' | xargs goimports -w -local github.com/evmos/evmos
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -name '*.pb.go' | xargs gofumpt -w -l

.PHONY: format

###############################################################################
### Protobuf ###
###############################################################################

containerProtoVer=v0.2
containerProtoVer=v0.7
containerProtoImage=tendermintdev/sdk-proto-gen:$(containerProtoVer)
containerProtoGen=cosmos-sdk-proto-gen-$(containerProtoVer)
containerProtoGenSwagger=cosmos-sdk-proto-gen-swagger-$(containerProtoVer)
Expand All @@ -468,19 +467,18 @@ proto-check-breaking:
@$(DOCKER_BUF) breaking --against $(HTTPS_GIT)#branch=main


TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.15/proto/tendermint
TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.20/proto/tendermint
GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos
COSMOS_SDK_URL = https://raw.githubusercontent.com/cosmos/cosmos-sdk/v0.45.1
ETHERMINT_URL = https://raw.githubusercontent.com/tharsis/ethermint/v0.10.0
IBC_GO_URL = https://raw.githubusercontent.com/cosmos/ibc-go/v3.0.0-rc0
COSMOS_SDK_URL = https://raw.githubusercontent.com/cosmos/cosmos-sdk/v0.46.0
ETHERMINT_URL = https://raw.githubusercontent.com/evmos/ethermint/v0.6.1
IBC_GO_URL = https://raw.githubusercontent.com/cosmos/ibc-go/v5.0.0-beta1
COSMOS_PROTO_URL = https://raw.githubusercontent.com/regen-network/cosmos-proto/master

TM_CRYPTO_TYPES = third_party/proto/tendermint/crypto
TM_ABCI_TYPES = third_party/proto/tendermint/abci
TM_TYPES = third_party/proto/tendermint/types

GOGO_PROTO_TYPES = third_party/proto/gogoproto

COSMOS_PROTO_TYPES = third_party/proto/cosmos_proto

proto-update-deps:
Expand Down
7 changes: 4 additions & 3 deletions app/ante/ante.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package ante

import (
sdkerrors "cosmossdk.io/errors"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
authante "github.com/cosmos/cosmos-sdk/x/auth/ante"

ethante "github.com/evmos/ethermint/app/ante"
Expand Down Expand Up @@ -33,7 +34,7 @@ func NewAnteHandler(options HandlerOptions) sdk.AnteHandler {
anteHandler = newCosmosAnteHandlerEip712(options)
default:
return ctx, sdkerrors.Wrapf(
sdkerrors.ErrUnknownExtensionOptions,
errortypes.ErrUnknownExtensionOptions,
"rejecting tx with unsupported extension option: %s", typeURL,
)
}
Expand All @@ -47,7 +48,7 @@ func NewAnteHandler(options HandlerOptions) sdk.AnteHandler {
case sdk.Tx:
anteHandler = newCosmosAnteHandler(options)
default:
return ctx, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "invalid transaction type: %T", tx)
return ctx, sdkerrors.Wrapf(errortypes.ErrUnknownRequest, "invalid transaction type: %T", tx)
}

return anteHandler(ctx, tx, sim)
Expand Down
7 changes: 4 additions & 3 deletions app/ante/comission.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package ante
import (
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
errortypes "github.com/cosmos/cosmos-sdk/types/errors"

sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
sdkerrors "cosmossdk.io/errors"
"github.com/cosmos/cosmos-sdk/x/authz"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
)
Expand Down Expand Up @@ -70,13 +71,13 @@ func (vcd ValidatorCommissionDecorator) validateMsg(_ sdk.Context, msg sdk.Msg)
case *stakingtypes.MsgCreateValidator:
if msg.Commission.Rate.LT(minCommission) {
return sdkerrors.Wrapf(
sdkerrors.ErrInvalidRequest,
errortypes.ErrInvalidRequest,
"validator commission %s be lower than minimum of %s", msg.Commission.Rate, minCommission)
}
case *stakingtypes.MsgEditValidator:
if msg.CommissionRate != nil && msg.CommissionRate.LT(minCommission) {
return sdkerrors.Wrapf(
sdkerrors.ErrInvalidRequest,
errortypes.ErrInvalidRequest,
"validator commission %s be lower than minimum of %s", msg.CommissionRate, minCommission)
}
}
Expand Down
57 changes: 29 additions & 28 deletions app/ante/handler_options.go
Original file line number Diff line number Diff line change
@@ -1,57 +1,60 @@
package ante

import (
sdkerrors "cosmossdk.io/errors"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
ibcante "github.com/cosmos/ibc-go/v3/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper"
ibcante "github.com/cosmos/ibc-go/v5/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v5/modules/core/keeper"

ethante "github.com/evmos/ethermint/app/ante"
evmtypes "github.com/evmos/ethermint/x/evm/types"

vestingtypes "github.com/evmos/evmos/v8/x/vesting/types"
vestingtypes "github.com/evmos/evmos/v9/x/vesting/types"
)

// HandlerOptions defines the list of module keepers required to run the Evmos
// AnteHandler decorators.
type HandlerOptions struct {
AccountKeeper evmtypes.AccountKeeper
BankKeeper evmtypes.BankKeeper
IBCKeeper *ibckeeper.Keeper
FeeMarketKeeper evmtypes.FeeMarketKeeper
StakingKeeper vestingtypes.StakingKeeper
EvmKeeper ethante.EVMKeeper
FeegrantKeeper ante.FeegrantKeeper
SignModeHandler authsigning.SignModeHandler
SigGasConsumer func(meter sdk.GasMeter, sig signing.SignatureV2, params authtypes.Params) error
Cdc codec.BinaryCodec
MaxTxGasWanted uint64
AccountKeeper evmtypes.AccountKeeper
BankKeeper evmtypes.BankKeeper
ExtensionOptionChecker ante.ExtensionOptionChecker
IBCKeeper *ibckeeper.Keeper
FeeMarketKeeper evmtypes.FeeMarketKeeper
StakingKeeper vestingtypes.StakingKeeper
EvmKeeper ethante.EVMKeeper
FeegrantKeeper ante.FeegrantKeeper
SignModeHandler authsigning.SignModeHandler
SigGasConsumer func(meter sdk.GasMeter, sig signing.SignatureV2, params authtypes.Params) error
Cdc codec.BinaryCodec
MaxTxGasWanted uint64
TxFeeChecker ante.TxFeeChecker
}

// Validate checks if the keepers are defined
func (options HandlerOptions) Validate() error {
if options.AccountKeeper == nil {
return sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler")
return sdkerrors.Wrap(errortypes.ErrLogic, "account keeper is required for AnteHandler")
}
if options.BankKeeper == nil {
return sdkerrors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler")
return sdkerrors.Wrap(errortypes.ErrLogic, "bank keeper is required for AnteHandler")
}
if options.StakingKeeper == nil {
return sdkerrors.Wrap(sdkerrors.ErrLogic, "staking keeper is required for AnteHandler")
return sdkerrors.Wrap(errortypes.ErrLogic, "staking keeper is required for AnteHandler")
}
if options.SignModeHandler == nil {
return sdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
return sdkerrors.Wrap(errortypes.ErrLogic, "sign mode handler is required for ante builder")
}
if options.FeeMarketKeeper == nil {
return sdkerrors.Wrap(sdkerrors.ErrLogic, "fee market keeper is required for AnteHandler")
return sdkerrors.Wrap(errortypes.ErrLogic, "fee market keeper is required for AnteHandler")
}
if options.EvmKeeper == nil {
return sdkerrors.Wrap(sdkerrors.ErrLogic, "evm keeper is required for AnteHandler")
return sdkerrors.Wrap(errortypes.ErrLogic, "evm keeper is required for AnteHandler")
}
return nil
}
Expand Down Expand Up @@ -79,14 +82,13 @@ func newCosmosAnteHandler(options HandlerOptions) sdk.AnteHandler {
return sdk.ChainAnteDecorators(
ethante.RejectMessagesDecorator{}, // reject MsgEthereumTxs
ante.NewSetUpContextDecorator(),
ante.NewRejectExtensionOptionsDecorator(),
danburck marked this conversation as resolved.
Show resolved Hide resolved
ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker),
ante.NewValidateBasicDecorator(),
ante.NewMempoolFeeDecorator(),
ethante.NewMinGasPriceDecorator(options.FeeMarketKeeper, options.EvmKeeper),
ante.NewTxTimeoutHeightDecorator(),
ante.NewValidateMemoDecorator(options.AccountKeeper),
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper),
ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker),
NewVestingDelegationDecorator(options.AccountKeeper, options.StakingKeeper, options.Cdc),
NewValidatorCommissionDecorator(options.Cdc),
// SetPubKeyDecorator must be called before all signature verification decorators
Expand All @@ -95,7 +97,7 @@ func newCosmosAnteHandler(options HandlerOptions) sdk.AnteHandler {
ante.NewSigGasConsumeDecorator(options.AccountKeeper, options.SigGasConsumer),
ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
ante.NewIncrementSequenceDecorator(options.AccountKeeper),
ibcante.NewAnteDecorator(options.IBCKeeper),
ibcante.NewRedundantRelayDecorator(options.IBCKeeper),
ethante.NewGasWantedDecorator(options.EvmKeeper, options.FeeMarketKeeper),
)
}
Expand All @@ -105,13 +107,12 @@ func newCosmosAnteHandlerEip712(options HandlerOptions) sdk.AnteHandler {
return sdk.ChainAnteDecorators(
ethante.RejectMessagesDecorator{}, // reject MsgEthereumTxs
ante.NewSetUpContextDecorator(),
ante.NewMempoolFeeDecorator(),
ante.NewValidateBasicDecorator(),
ethante.NewMinGasPriceDecorator(options.FeeMarketKeeper, options.EvmKeeper),
ante.NewTxTimeoutHeightDecorator(),
ante.NewValidateMemoDecorator(options.AccountKeeper),
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper),
ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker),
NewVestingDelegationDecorator(options.AccountKeeper, options.StakingKeeper, options.Cdc),
NewValidatorCommissionDecorator(options.Cdc),
// SetPubKeyDecorator must be called before all signature verification decorators
Expand All @@ -121,7 +122,7 @@ func newCosmosAnteHandlerEip712(options HandlerOptions) sdk.AnteHandler {
// Note: signature verification uses EIP instead of the cosmos signature validator
ethante.NewEip712SigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
ante.NewIncrementSequenceDecorator(options.AccountKeeper),
ibcante.NewAnteDecorator(options.IBCKeeper),
ibcante.NewRedundantRelayDecorator(options.IBCKeeper),
ethante.NewGasWantedDecorator(options.EvmKeeper, options.FeeMarketKeeper),
)
}
9 changes: 5 additions & 4 deletions app/ante/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"testing"
"time"

"cosmossdk.io/math"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
Expand All @@ -18,8 +19,8 @@ import (
"github.com/evmos/ethermint/encoding"
evmtypes "github.com/evmos/ethermint/x/evm/types"
feemarkettypes "github.com/evmos/ethermint/x/feemarket/types"
"github.com/evmos/evmos/v8/app"
claimstypes "github.com/evmos/evmos/v8/x/claims/types"
"github.com/evmos/evmos/v9/app"
claimstypes "github.com/evmos/evmos/v9/x/claims/types"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto/tmhash"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
Expand Down Expand Up @@ -91,7 +92,7 @@ func (suite *AnteTestSuite) CommitAfter(t time.Duration) {
suite.app.EndBlock(abci.RequestEndBlock{Height: header.Height})
_ = suite.app.Commit()

header.Height += 1
header.Height++
header.Time = header.Time.Add(t)
suite.app.BeginBlock(abci.RequestBeginBlock{
Header: header,
Expand All @@ -101,7 +102,7 @@ func (suite *AnteTestSuite) CommitAfter(t time.Duration) {
suite.ctx = suite.app.BaseApp.NewContext(false, header)
}

func (s *AnteTestSuite) CreateTestTxBuilder(gasPrice sdk.Int, denom string, msgs ...sdk.Msg) client.TxBuilder {
func (s *AnteTestSuite) CreateTestTxBuilder(gasPrice math.Int, denom string, msgs ...sdk.Msg) client.TxBuilder {
encodingConfig := encoding.MakeConfig(app.ModuleBasics)
gasLimit := uint64(1000000)

Expand Down
11 changes: 6 additions & 5 deletions app/ante/vesting.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"

sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
sdkerrors "cosmossdk.io/errors"
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/authz"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
evmtypes "github.com/evmos/ethermint/x/evm/types"
vestingtypes "github.com/evmos/evmos/v8/x/vesting/types"
vestingtypes "github.com/evmos/evmos/v9/x/vesting/types"
)

// EthVestingTransactionDecorator validates if clawback vesting accounts are
Expand Down Expand Up @@ -36,14 +37,14 @@ func (vtd EthVestingTransactionDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx,
for _, msg := range tx.GetMsgs() {
msgEthTx, ok := msg.(*evmtypes.MsgEthereumTx)
if !ok {
return ctx, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest,
return ctx, sdkerrors.Wrapf(errortypes.ErrUnknownRequest,
"invalid message type %T, expected %T", msg, (*evmtypes.MsgEthereumTx)(nil),
)
}

acc := vtd.ak.GetAccount(ctx, msgEthTx.GetFrom())
if acc == nil {
return ctx, sdkerrors.Wrapf(sdkerrors.ErrUnknownAddress,
return ctx, sdkerrors.Wrapf(errortypes.ErrUnknownAddress,
"account %s does not exist", acc)
}

Expand Down Expand Up @@ -141,7 +142,7 @@ func (vdd VestingDelegationDecorator) validateMsg(ctx sdk.Context, msg sdk.Msg)
acc := vdd.ak.GetAccount(ctx, addr)
if acc == nil {
return sdkerrors.Wrapf(
sdkerrors.ErrUnknownAddress,
errortypes.ErrUnknownAddress,
"account %s does not exist", addr,
)
}
Expand Down