Skip to content

Commit 61eedfc

Browse files
authored
refactor(types)!: move types to respective folders and remove /types (#639)
* Move types to respective folders * fix validation test * use genesis type * Revert "use genesis type" This reverts commit 19cf990. * lints * lints - cont. * changelog, reference fixes * migration fix * lint * apply fixes * some more 2 imports * lints * types2 no more * Changelog * add relevant import changes to migration guide * proto changes * fix comments
1 parent de4e879 commit 61eedfc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+732
-694
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
- [\#609](https://github.com/cosmos/evm/pull/609) Make `erc20Keeper` optional in the EVM keeper
4242
- [\#624](https://github.com/cosmos/evm/pull/624) Cleanup unnecessary `fix-revert-gas-refund-height`.
4343
- [\#635](https://github.com/cosmos/evm/pull/635) Move DefaultStaticPrecompiles to /evm and allow projects to set it by default alongside the keeper.
44+
- [\#639](https://github.com/cosmos/evm/pull/639) Remove `/types` and move types into respective folders.
4445
- [\#630](https://github.com/cosmos/evm/pull/630) Reduce feemarket parameter loading to minimize memory allocations.
4546
- [\#577](https://github.com/cosmos/evm/pull/577) Cleanup precompiles boilerplate code.
4647
- [\#648](https://github.com/cosmos/evm/pull/648) Move all `ante` logic such as `NewAnteHandler` from the `evmd` package to `evm/ante` so it can be used as library functions.

ante/cosmos/eip712.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
anteinterfaces "github.com/cosmos/evm/ante/interfaces"
1212
"github.com/cosmos/evm/crypto/ethsecp256k1"
1313
"github.com/cosmos/evm/ethereum/eip712"
14-
"github.com/cosmos/evm/types"
1514

1615
errorsmod "cosmossdk.io/errors"
1716

@@ -30,7 +29,7 @@ var evmCodec codec.ProtoCodecMarshaler
3029

3130
func init() {
3231
registry := codectypes.NewInterfaceRegistry()
33-
types.RegisterInterfaces(registry)
32+
eip712.RegisterInterfaces(registry)
3433
evmCodec = codec.NewProtoCodec(registry)
3534
}
3635

@@ -204,7 +203,7 @@ func VerifySignature(
204203
return errorsmod.Wrap(errortypes.ErrUnknownExtensionOptions, "tx doesn't contain expected amount of extension options")
205204
}
206205

207-
extOpt, ok := opts[0].GetCachedValue().(*types.ExtensionOptionsWeb3Tx)
206+
extOpt, ok := opts[0].GetCachedValue().(*eip712.ExtensionOptionsWeb3Tx)
208207
if !ok {
209208
return errorsmod.Wrap(errortypes.ErrUnknownExtensionOptions, "unknown extension option")
210209
}

ante/evm/08_gas_consume.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
ethtypes "github.com/ethereum/go-ethereum/core/types"
88

99
anteinterfaces "github.com/cosmos/evm/ante/interfaces"
10-
"github.com/cosmos/evm/types"
10+
antetypes "github.com/cosmos/evm/ante/types"
1111
evmtypes "github.com/cosmos/evm/x/vm/types"
1212

1313
errorsmod "cosmossdk.io/errors"
@@ -99,7 +99,7 @@ func GetMsgPriority(
9999

100100
// TODO: (@fedekunze) Why is this necessary? This seems to be a duplicate from the CheckGasWanted function.
101101
func CheckBlockGasLimit(ctx sdktypes.Context, gasWanted uint64, minPriority int64) (sdktypes.Context, error) {
102-
blockGasLimit := types.BlockGasLimit(ctx)
102+
blockGasLimit := antetypes.BlockGasLimit(ctx)
103103

104104
// return error if the tx gas is greater than the block limit (max gas)
105105

@@ -122,7 +122,7 @@ func CheckBlockGasLimit(ctx sdktypes.Context, gasWanted uint64, minPriority int6
122122
// FIXME: use a custom gas configuration that doesn't add any additional gas and only
123123
// takes into account the gas consumed at the end of the EVM transaction.
124124
ctx = ctx.
125-
WithGasMeter(types.NewInfiniteGasMeterWithLimit(gasWanted)).
125+
WithGasMeter(evmtypes.NewInfiniteGasMeterWithLimit(gasWanted)).
126126
WithPriority(minPriority)
127127

128128
return ctx, nil

ante/evm/10_gas_wanted.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"math/big"
55

66
anteinterfaces "github.com/cosmos/evm/ante/interfaces"
7-
"github.com/cosmos/evm/types"
7+
"github.com/cosmos/evm/ante/types"
88
feemarkettypes "github.com/cosmos/evm/x/feemarket/types"
99
evmtypes "github.com/cosmos/evm/x/vm/types"
1010

ante/evm/fee_checker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55

66
"github.com/ethereum/go-ethereum/params"
77

8-
cosmosevmtypes "github.com/cosmos/evm/types"
8+
cosmosevmtypes "github.com/cosmos/evm/ante/types"
99
feemarkettypes "github.com/cosmos/evm/x/feemarket/types"
1010
evmtypes "github.com/cosmos/evm/x/vm/types"
1111

ante/evm/fee_checker_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import (
99
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
1010

1111
"github.com/cosmos/evm/ante/evm"
12+
"github.com/cosmos/evm/ante/types"
1213
"github.com/cosmos/evm/config"
1314
"github.com/cosmos/evm/encoding"
1415
testconstants "github.com/cosmos/evm/testutil/constants"
15-
"github.com/cosmos/evm/types"
1616
feemarkettypes "github.com/cosmos/evm/x/feemarket/types"
1717
evmtypes "github.com/cosmos/evm/x/vm/types"
1818

File renamed without changes.
File renamed without changes.

types/dynamic_fee.pb.go renamed to ante/types/dynamic_fee.pb.go

Lines changed: 22 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)