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 6 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
3 changes: 1 addition & 2 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
# Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file)
# and commit this file to your remote git repository to share the goodness with others.

image: ghcr.io/faddat/cosmos

image: ghcr.io/notional-labs/cosmos

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0
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
IBC_GO_URL = https://raw.githubusercontent.com/cosmos/ibc-go/v4.0.0-rc0
COSMOS_PROTO_URL = https://raw.githubusercontent.com/regen-network/cosmos-proto/master

TM_CRYPTO_TYPES = third_party/proto/tendermint/crypto
Expand Down
15 changes: 8 additions & 7 deletions app/ante/handler_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"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/v4/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"

ethante "github.com/evmos/ethermint/app/ante"
evmtypes "github.com/evmos/ethermint/x/evm/types"
Expand All @@ -31,6 +31,7 @@ type HandlerOptions struct {
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
Expand Down Expand Up @@ -79,14 +80,14 @@ 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.NewRejectExtensionOptionsDecorator(),
ante.NewValidateBasicDecorator(),
ante.NewMempoolFeeDecorator(),
// ante.NewMempoolFeeDecorator(),
danburck marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -105,13 +106,13 @@ func newCosmosAnteHandlerEip712(options HandlerOptions) sdk.AnteHandler {
return sdk.ChainAnteDecorators(
ethante.RejectMessagesDecorator{}, // reject MsgEthereumTxs
ante.NewSetUpContextDecorator(),
ante.NewMempoolFeeDecorator(),
// ante.NewMempoolFeeDecorator(),
danburck marked this conversation as resolved.
Show resolved Hide resolved
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 Down
98 changes: 57 additions & 41 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/grpc/tmservice"
"github.com/cosmos/cosmos-sdk/client/rpc"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/server/api"
Expand Down Expand Up @@ -62,8 +61,11 @@ import (
"github.com/cosmos/cosmos-sdk/x/genutil"
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
"github.com/cosmos/cosmos-sdk/x/gov"
govclient "github.com/cosmos/cosmos-sdk/x/gov/client"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
"github.com/cosmos/cosmos-sdk/x/params"
paramsclient "github.com/cosmos/cosmos-sdk/x/params/client"
paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper"
Expand All @@ -80,24 +82,23 @@ import (
upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

"github.com/cosmos/ibc-go/v3/modules/apps/transfer"
ibctransferkeeper "github.com/cosmos/ibc-go/v3/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v3/modules/core"
ibcclient "github.com/cosmos/ibc-go/v3/modules/core/02-client"
ibcclientclient "github.com/cosmos/ibc-go/v3/modules/core/02-client/client"
ibcclienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"
porttypes "github.com/cosmos/ibc-go/v3/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper"
ibctesting "github.com/cosmos/ibc-go/v3/testing"
"github.com/cosmos/ibc-go/v4/modules/apps/transfer"
ibctransferkeeper "github.com/cosmos/ibc-go/v4/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v4/modules/core"
ibcclient "github.com/cosmos/ibc-go/v4/modules/core/02-client"
ibcclientclient "github.com/cosmos/ibc-go/v4/modules/core/02-client/client"
ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"
porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"
ibctesting "github.com/cosmos/ibc-go/v4/testing"

ethermintapp "github.com/evmos/ethermint/app"
"github.com/evmos/ethermint/encoding"
srvflags "github.com/evmos/ethermint/server/flags"
ethermint "github.com/evmos/ethermint/types"
"github.com/evmos/ethermint/x/evm"
evmrest "github.com/evmos/ethermint/x/evm/client/rest"
evmkeeper "github.com/evmos/ethermint/x/evm/keeper"
evmtypes "github.com/evmos/ethermint/x/evm/types"
"github.com/evmos/ethermint/x/feemarket"
Expand Down Expand Up @@ -174,11 +175,13 @@ var (
staking.AppModuleBasic{},
distr.AppModuleBasic{},
gov.NewAppModuleBasic(
paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.ProposalHandler, upgradeclient.CancelProposalHandler,
ibcclientclient.UpdateClientProposalHandler, ibcclientclient.UpgradeProposalHandler,
// Evmos proposal types
erc20client.RegisterCoinProposalHandler, erc20client.RegisterERC20ProposalHandler, erc20client.ToggleTokenConversionProposalHandler,
incentivesclient.RegisterIncentiveProposalHandler, incentivesclient.CancelIncentiveProposalHandler,
[]govclient.ProposalHandler{
danburck marked this conversation as resolved.
Show resolved Hide resolved
paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.LegacyProposalHandler, upgradeclient.LegacyCancelProposalHandler,
ibcclientclient.UpdateClientProposalHandler, ibcclientclient.UpgradeProposalHandler,
// Evmos proposal types
erc20client.RegisterCoinProposalHandler, erc20client.RegisterERC20ProposalHandler, erc20client.ToggleTokenConversionProposalHandler,
incentivesclient.RegisterIncentiveProposalHandler, incentivesclient.CancelIncentiveProposalHandler,
},
),
params.AppModuleBasic{},
crisis.AppModuleBasic{},
Expand Down Expand Up @@ -243,9 +246,9 @@ type Evmos struct {
invCheckPeriod uint

// keys to access the substores
keys map[string]*sdk.KVStoreKey
tkeys map[string]*sdk.TransientStoreKey
memKeys map[string]*sdk.MemoryStoreKey
keys map[string]*storetypes.KVStoreKey
tkeys map[string]*storetypes.TransientStoreKey
memKeys map[string]*storetypes.MemoryStoreKey

// keepers
AccountKeeper authkeeper.AccountKeeper
Expand Down Expand Up @@ -307,7 +310,7 @@ func NewEvmos(
appOpts servertypes.AppOptions,
baseAppOptions ...func(*baseapp.BaseApp),
) *Evmos {
appCodec := encodingConfig.Marshaler
appCodec := encodingConfig.Codec
cdc := encodingConfig.Amino
interfaceRegistry := encodingConfig.InterfaceRegistry

Expand Down Expand Up @@ -358,7 +361,7 @@ func NewEvmos(
// init params keeper and subspaces
app.ParamsKeeper = initParamsKeeper(appCodec, cdc, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey])
// set the BaseApp's parameter store
bApp.SetParamStore(app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramskeeper.ConsensusParamsKeyTable()))
bApp.SetParamStore(app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable()))

// add capability keeper and ScopeToModule for ibc module
app.CapabilityKeeper = capabilitykeeper.NewKeeper(appCodec, keys[capabilitytypes.StoreKey], memKeys[capabilitytypes.MemStoreKey])
Expand All @@ -372,7 +375,7 @@ func NewEvmos(

// use custom Ethermint account for contracts
app.AccountKeeper = authkeeper.NewAccountKeeper(
appCodec, keys[authtypes.StoreKey], app.GetSubspace(authtypes.ModuleName), ethermint.ProtoAccount, maccPerms,
appCodec, keys[authtypes.StoreKey], app.GetSubspace(authtypes.ModuleName), authtypes.ProtoBaseAccount, maccPerms, sdk.GetConfig().GetBech32AccountAddrPrefix(),
)
app.BankKeeper = bankkeeper.NewBaseKeeper(
appCodec, keys[banktypes.StoreKey], app.AccountKeeper, app.GetSubspace(banktypes.ModuleName), app.BlockedAddrs(),
Expand All @@ -382,7 +385,7 @@ func NewEvmos(
)
app.DistrKeeper = distrkeeper.NewKeeper(
appCodec, keys[distrtypes.StoreKey], app.GetSubspace(distrtypes.ModuleName), app.AccountKeeper, app.BankKeeper,
&stakingKeeper, authtypes.FeeCollectorName, app.ModuleAccountAddrs(),
&stakingKeeper, authtypes.FeeCollectorName,
)
app.SlashingKeeper = slashingkeeper.NewKeeper(
appCodec, keys[slashingtypes.StoreKey], &stakingKeeper, app.GetSubspace(slashingtypes.ModuleName),
Expand All @@ -391,9 +394,9 @@ func NewEvmos(
app.GetSubspace(crisistypes.ModuleName), invCheckPeriod, app.BankKeeper, authtypes.FeeCollectorName,
)
app.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, keys[feegrant.StoreKey], app.AccountKeeper)
app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath, app.BaseApp)
app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath, app.BaseApp, authtypes.NewModuleAddress(govtypes.ModuleName).String())

app.AuthzKeeper = authzkeeper.NewKeeper(keys[authzkeeper.StoreKey], appCodec, app.BaseApp.MsgServiceRouter())
app.AuthzKeeper = authzkeeper.NewKeeper(keys[authzkeeper.StoreKey], appCodec, app.MsgServiceRouter(), app.AccountKeeper)

tracer := cast.ToString(appOpts.Get(srvflags.EVMTracer))

Expand All @@ -414,18 +417,29 @@ func NewEvmos(
)

// register the proposal types
govRouter := govtypes.NewRouter()
govRouter.AddRoute(govtypes.RouterKey, govtypes.ProposalHandler).
govRouter := govv1beta1.NewRouter()
govRouter.AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler).
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)).
AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)).
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)).
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)).
AddRoute(erc20types.RouterKey, erc20.NewErc20ProposalHandler(&app.Erc20Keeper)).
AddRoute(incentivestypes.RouterKey, incentives.NewIncentivesProposalHandler(&app.IncentivesKeeper))

govConfig := govtypes.DefaultConfig()
/*
Example of setting gov params:
govConfig.MaxMetadataLen = 10000
*/
govKeeper := govkeeper.NewKeeper(
appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName),
app.AccountKeeper, app.BankKeeper, &stakingKeeper, govRouter,
appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper,
&stakingKeeper, govRouter, app.MsgServiceRouter(), govConfig,
)

app.GovKeeper = *govKeeper.SetHooks(
govtypes.NewMultiGovHooks(
// register the governance hooks
),
)

// Evmos Keeper
Expand Down Expand Up @@ -887,21 +901,21 @@ func (app *Evmos) InterfaceRegistry() types.InterfaceRegistry {
// GetKey returns the KVStoreKey for the provided store key.
//
// NOTE: This is solely to be used for testing purposes.
func (app *Evmos) GetKey(storeKey string) *sdk.KVStoreKey {
func (app *Evmos) GetKey(storeKey string) *storetypes.KVStoreKey {
return app.keys[storeKey]
}

// GetTKey returns the TransientStoreKey for the provided store key.
//
// NOTE: This is solely to be used for testing purposes.
func (app *Evmos) GetTKey(storeKey string) *sdk.TransientStoreKey {
func (app *Evmos) GetTKey(storeKey string) *storetypes.TransientStoreKey {
return app.tkeys[storeKey]
}

// GetMemKey returns the MemStoreKey for the provided mem key.
//
// NOTE: This is solely used for testing purposes.
func (app *Evmos) GetMemKey(storeKey string) *sdk.MemoryStoreKey {
func (app *Evmos) GetMemKey(storeKey string) *storetypes.MemoryStoreKey {
return app.memKeys[storeKey]
}

Expand All @@ -922,17 +936,13 @@ func (app *Evmos) SimulationManager() *module.SimulationManager {
// API server.
func (app *Evmos) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) {
clientCtx := apiSvr.ClientCtx
rpc.RegisterRoutes(clientCtx, apiSvr.Router)
danburck marked this conversation as resolved.
Show resolved Hide resolved

evmrest.RegisterTxRoutes(clientCtx, apiSvr.Router)

// Register new tx routes from grpc-gateway.
authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)
// Register new tendermint queries routes from grpc-gateway.
tmservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)

// Register legacy and grpc-gateway routes for all modules.
ModuleBasics.RegisterRESTRoutes(clientCtx, apiSvr.Router)
ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)

// register swagger API from root so that other applications can override easily
Expand All @@ -945,8 +955,14 @@ func (app *Evmos) RegisterTxService(clientCtx client.Context) {
authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry)
}

// RegisterTendermintService implements the Application.RegisterTendermintService method.
func (app *Evmos) RegisterTendermintService(clientCtx client.Context) {
tmservice.RegisterTendermintService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.interfaceRegistry)
tmservice.RegisterTendermintService(
clientCtx,
app.BaseApp.GRPCQueryRouter(),
app.interfaceRegistry,
app.Query,
)
}

// IBC Go TestingApp functions
Expand Down Expand Up @@ -1000,7 +1016,7 @@ func GetMaccPerms() map[string][]string {

// initParamsKeeper init params keeper and its subspaces
func initParamsKeeper(
appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey sdk.StoreKey,
appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey storetypes.StoreKey,
) paramskeeper.Keeper {
paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey)

Expand All @@ -1010,7 +1026,7 @@ func initParamsKeeper(
paramsKeeper.Subspace(stakingtypes.ModuleName)
paramsKeeper.Subspace(distrtypes.ModuleName)
paramsKeeper.Subspace(slashingtypes.ModuleName)
paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypes.ParamKeyTable())
paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable())
paramsKeeper.Subspace(crisistypes.ModuleName)
paramsKeeper.Subspace(ibctransfertypes.ModuleName)
paramsKeeper.Subspace(ibchost.ModuleName)
Expand Down
2 changes: 1 addition & 1 deletion app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
// NewDefaultGenesisState generates the default state for the application.
func NewDefaultGenesisState() simapp.GenesisState {
encCfg := encoding.MakeConfig(ModuleBasics)
return ModuleBasics.DefaultGenesis(encCfg.Marshaler)
return ModuleBasics.DefaultGenesis(encCfg.Codec)
}

// ExportAppStateAndValidators exports the state of the application for a genesis
Expand Down
2 changes: 1 addition & 1 deletion app/sigverify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/cosmos/cosmos-sdk/crypto/types/multisig"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
"github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx"
"github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"

"github.com/evmos/ethermint/crypto/ethsecp256k1"
Expand Down
4 changes: 2 additions & 2 deletions app/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"time"

sdk "github.com/cosmos/cosmos-sdk/types"
ibctesting "github.com/cosmos/ibc-go/v3/testing"
"github.com/cosmos/ibc-go/v3/testing/simapp"
ibctesting "github.com/cosmos/ibc-go/v4/testing"
"github.com/cosmos/ibc-go/v4/testing/simapp"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
Expand Down
4 changes: 2 additions & 2 deletions app/upgrades/v4/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
ibcclientkeeper "github.com/cosmos/ibc-go/v3/modules/core/02-client/keeper"
ibcclienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"
ibcclientkeeper "github.com/cosmos/ibc-go/v4/modules/core/02-client/keeper"
ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"

"github.com/evmos/evmos/v6/types"
)
Expand Down
4 changes: 2 additions & 2 deletions app/upgrades/v4/upgrades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"

clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"
tmclient "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types"
clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"
tmclient "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types"

"github.com/evmos/ethermint/crypto/ethsecp256k1"
feemarkettypes "github.com/evmos/ethermint/x/feemarket/types"
Expand Down
4 changes: 2 additions & 2 deletions app/upgrades/v5/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

ibctransferkeeper "github.com/cosmos/ibc-go/v3/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"
ibctransferkeeper "github.com/cosmos/ibc-go/v4/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"

feemarketv010types "github.com/evmos/ethermint/x/feemarket/migrations/v010/types"
feemarketv011 "github.com/evmos/ethermint/x/feemarket/migrations/v011"
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v5/upgrades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/evmos/ethermint/tests"
feemarkettypes "github.com/evmos/ethermint/x/feemarket/types"

ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"
ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"

"github.com/evmos/evmos/v6/app"
v5 "github.com/evmos/evmos/v6/app/upgrades/v5"
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v6/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

ibctransferkeeper "github.com/cosmos/ibc-go/v3/modules/apps/transfer/keeper"
ibctransferkeeper "github.com/cosmos/ibc-go/v4/modules/apps/transfer/keeper"

evmtypes "github.com/evmos/ethermint/x/evm/types"
feemarkettypes "github.com/evmos/ethermint/x/feemarket/types"
Expand Down