Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- [\#756](https://github.com/cosmos/evm/pull/756) Fix error message typo in NewMsgCancelProposal.
- [\#772](https://github.com/cosmos/evm/pull/772) Avoid panic on close if evm mempool not used.
- [\#774](https://github.com/cosmos/evm/pull/774) Emit proper allowance amount in erc20 event.
- [\#790](https://github.com/cosmos/evm/pull/790) fix panic in historical query due to missing EvmCoinInfo.

## v0.5.0

Expand Down
2 changes: 1 addition & 1 deletion x/vm/keeper/coin_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (k Keeper) GetEvmCoinInfo(ctx sdk.Context) (coinInfo types.EvmCoinInfo) {
store := ctx.KVStore(k.storeKey)
bz := store.Get(types.KeyPrefixEvmCoinInfo)
if bz == nil {
return coinInfo
return k.defaultEvmCoinInfo
}
k.cdc.MustUnmarshal(bz, &coinInfo)
return
Expand Down
10 changes: 10 additions & 0 deletions x/vm/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ type Keeper struct {
// virtualFeeCollection enabling will use "Virtual" methods from the bank module to accumulate
// fees to the fee collector module in the endBlocker instead of using regular sends during tx execution.
virtualFeeCollection bool

// defaultEvmCoinInfo is the default EVM coin info used when evmCoinInfo is not initialized in the state,
// mainly for historical queries.
defaultEvmCoinInfo types.EvmCoinInfo
}

// NewKeeper generates new evm module keeper
Expand Down Expand Up @@ -154,6 +158,12 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger {
return ctx.Logger().With("module", types.ModuleName)
}

// WithDefaultEvmCoinInfo set default EvmCoinInfo
func (k *Keeper) WithDefaultEvmCoinInfo(coinInfo types.EvmCoinInfo) *Keeper {
k.defaultEvmCoinInfo = coinInfo
return k
}

// ----------------------------------------------------------------------------
// Block Bloom
// Required by Web3 API.
Expand Down
Loading