File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed
Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 2222- [ \# 756] ( https://github.com/cosmos/evm/pull/756 ) Fix error message typo in NewMsgCancelProposal.
2323- [ \# 772] ( https://github.com/cosmos/evm/pull/772 ) Avoid panic on close if evm mempool not used.
2424- [ \# 774] ( https://github.com/cosmos/evm/pull/774 ) Emit proper allowance amount in erc20 event.
25+ - [ \# 790] ( https://github.com/cosmos/evm/pull/790 ) fix panic in historical query due to missing EvmCoinInfo.
2526
2627## v0.5.0
2728
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ func (k Keeper) GetEvmCoinInfo(ctx sdk.Context) (coinInfo types.EvmCoinInfo) {
5656 store := ctx .KVStore (k .storeKey )
5757 bz := store .Get (types .KeyPrefixEvmCoinInfo )
5858 if bz == nil {
59- return coinInfo
59+ return k . defaultEvmCoinInfo
6060 }
6161 k .cdc .MustUnmarshal (bz , & coinInfo )
6262 return
Original file line number Diff line number Diff line change @@ -85,6 +85,10 @@ type Keeper struct {
8585 // virtualFeeCollection enabling will use "Virtual" methods from the bank module to accumulate
8686 // fees to the fee collector module in the endBlocker instead of using regular sends during tx execution.
8787 virtualFeeCollection bool
88+
89+ // defaultEvmCoinInfo is the default EVM coin info used when evmCoinInfo is not initialized in the state,
90+ // mainly for historical queries.
91+ defaultEvmCoinInfo types.EvmCoinInfo
8892}
8993
9094// NewKeeper generates new evm module keeper
@@ -154,6 +158,12 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger {
154158 return ctx .Logger ().With ("module" , types .ModuleName )
155159}
156160
161+ // WithDefaultEvmCoinInfo set default EvmCoinInfo
162+ func (k * Keeper ) WithDefaultEvmCoinInfo (coinInfo types.EvmCoinInfo ) * Keeper {
163+ k .defaultEvmCoinInfo = coinInfo
164+ return k
165+ }
166+
157167// ----------------------------------------------------------------------------
158168// Block Bloom
159169// Required by Web3 API.
You can’t perform that action at this time.
0 commit comments