Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

refactor(x/evm): move precommit to end block #1271

Merged
merged 1 commit into from
Nov 2, 2023
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
2 changes: 1 addition & 1 deletion cosmos/x/evm/keeper/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
)

// Precommit runs on the Cosmo-SDK lifecycle Precommit().
func (k *Keeper) Precommit(ctx context.Context) error {
func (k *Keeper) EndBlock(ctx context.Context) error {
// Verify that the EVM block was written.
// TODO: Set/GetHead to set and get the canonical head.
blockNum := uint64(sdk.UnwrapSDKContext(ctx).BlockHeight())
Expand Down
6 changes: 3 additions & 3 deletions cosmos/x/evm/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const ConsensusVersion = 1
var (
_ appmodule.HasServices = AppModule{}
_ appmodule.HasPrepareCheckState = AppModule{}
_ appmodule.HasPrecommit = AppModule{}
_ appmodule.HasEndBlocker = AppModule{}
_ module.AppModule = AppModule{}
_ module.AppModuleBasic = AppModuleBasic{}
)
Expand Down Expand Up @@ -132,6 +132,6 @@ func (am AppModule) PrepareCheckState(ctx context.Context) error {
}

// Precommit performs precommit operations.
func (am AppModule) Precommit(ctx context.Context) error {
return am.keeper.Precommit(ctx)
func (am AppModule) EndBlock(ctx context.Context) error {
return am.keeper.EndBlock(ctx)
}
4 changes: 1 addition & 3 deletions e2e/testapp/app_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,12 @@ func MakeAppConfig(bech32Prefix string) depinject.Config {
genutiltypes.ModuleName,
},
EndBlockers: []string{
evmtypes.ModuleName,
crisistypes.ModuleName,
govtypes.ModuleName,
stakingtypes.ModuleName,
genutiltypes.ModuleName,
},
Precommiters: []string{
evmtypes.ModuleName,
},
OverrideStoreKeys: []*runtimev1alpha1.StoreKeyConfig{
{
ModuleName: authtypes.ModuleName,
Expand Down
Loading