Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling of EVM Mono decorator for partners #36

Open
coderabbitai bot opened this issue Aug 13, 2024 · 0 comments
Open

Improve handling of EVM Mono decorator for partners #36

coderabbitai bot opened this issue Aug 13, 2024 · 0 comments
Assignees

Comments

@coderabbitai
Copy link

coderabbitai bot commented Aug 13, 2024

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)

@MalteHerrmann MalteHerrmann changed the title Address Code Duplication in Partner Repositories Improve handling of EVM Mono decorator for partners Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant