Skip to content

Commit f463746

Browse files
authored
fix: add InitEvmCoinInfo upgrade to avoid panic when denom is not registered (#736)
1 parent 42e1141 commit f463746

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
- [\#727](https://github.com/cosmos/evm/pull/727) Avoid nil pointer for `tx evm raw` due to uninitialized EVM coin info.
2929
- [\#730](https://github.com/cosmos/evm/pull/730) Fix panic if evm mempool not used.
3030
- [\#733](https://github.com/cosmos/evm/pull/733) Avoid rejecting tx with unsupported extension option for ExtensionOptionDynamicFeeTx.
31+
- [\#736](https://github.com/cosmos/evm/pull/736) Add InitEvmCoinInfo upgrade to avoid panic when denom is not registered.
3132

3233
### IMPROVEMENTS
3334

docs/migrations/v0.4.0_to_v0.5.0_UNRELEASED.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ not satisfy the following conditions.
312312
2. Your EVM Denom must have a display denom associated with it in `DenomMetadata`.
313313
1. The display denom for the EVM Denom must have an accurate decimal value (i.e. for `uatom`, `atom` must have a decimal value of 6.
314314
3. Your chain is an 18-decimal chain.
315+
4. Call `InitEvmCoinInfo` to initialize EVM coin metadata in the module store.
315316

316317
In your UpgradeHandler:
317318

evmd/upgrades.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package evmd
22

33
import (
44
"context"
5+
56
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
67
"github.com/cosmos/evm/x/vm/types"
78

@@ -59,7 +60,10 @@ func (app EVMD) RegisterUpgradeHandlers() {
5960
if err != nil {
6061
return nil, err
6162
}
62-
63+
// Initialize EvmCoinInfo in the module store
64+
if err := app.EVMKeeper.InitEvmCoinInfo(sdkCtx); err != nil {
65+
return nil, err
66+
}
6367
return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM)
6468
},
6569
)

0 commit comments

Comments
 (0)