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

Skip to content

Improve handling of EVM Mono decorator for partners #36

@coderabbitai

Description

@coderabbitai

Context

The evmOS repository provides utility functions for building an unified ante handler for EVM transactions, but currently every partner chain has to implement this handler for themselves.

Possible Solution

Maybe we can provide a capable ante handler that supports all evmOS logic being checked with some options struct to configure it. Using generics we could implement an interface to support different Apps.
Any evmOS chain could implement their EVM handler like this:

import (
  sdk "github.com/cosmos/cosmos-sdk/types"
  evmosevmante "github.com/evmos/os/ante/evm"
)

// newEVMAnteHandler creates the sdk.AnteHandler implementation for the EVM transactions.
func newEVMAnteHandler(options HandlerOptions) sdk.AnteHandler {
	return sdk.ChainAnteDecorators(
		evmosevmante.NewEVMAnteDecorator(evmosevmante.EVMHandlerOptions{
			// handler fields definition here
		}),
                // chain specific handlers could be added here
	)
}

The TODO comment in the PR suggests avoiding duplication in partner repositories by providing a shared utility or library. This issue is to track the task of implementing such a solution.

PR URL: #30
Comment URL: #30 (comment)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions