registry

package
v0.8.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2025 License: GPL-3.0, LGPL-3.0 Imports: 8 Imported by: 13

Documentation

Overview

Module to facilitate the registration of precompiles and their configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRegistry

func GetRegistry() precompile.PrecompileRegistry

GetRegistry returns the global registry instance

func RegisterModule

func RegisterModule(stm Module) error

RegisterModule registers a stateful precompile module

func ReservedAddress

func ReservedAddress(addr common.Address) bool

ReservedAddress returns true if [addr] is in a reserved range for custom precompiles

Types

type Module

type Module struct {
	// contains filtered or unexported fields
}

Module wraps a precompile contract with metadata

func GetPrecompileModule

func GetPrecompileModule(key string) (Module, bool)

func GetPrecompileModuleByAddress

func GetPrecompileModuleByAddress(address common.Address) (Module, bool)

Legacy functions for compatibility

func NewModule

func NewModule(configKey string, address common.Address, contract interface{}, configurator interface{}) Module

NewModule creates a new Module instance

func RegisteredModules

func RegisteredModules() []Module

func (Module) Address

func (m Module) Address() common.Address

Interface methods to satisfy precompile.PrecompileModule

func (Module) ConfigKey

func (m Module) ConfigKey() string

ConfigKey returns the module's config key (interface method)

func (Module) Configurator

func (m Module) Configurator() interface{}

func (Module) Contract

func (m Module) Contract() interface{}

func (Module) DefaultConfig

func (m Module) DefaultConfig() interface{}

func (Module) GetAddress

func (m Module) GetAddress() common.Address

GetAddress returns the module's address (for backward compatibility)

func (Module) GetConfigKey

func (m Module) GetConfigKey() string

GetConfigKey returns the module's config key (for backward compatibility)

func (Module) GetConfigurator

func (m Module) GetConfigurator() interface{}

GetConfigurator returns the module's configurator (for backward compatibility)

func (Module) GetContract

func (m Module) GetContract() interface{}

GetContract returns the module's contract (for backward compatibility)

func (Module) MakeConfig

func (m Module) MakeConfig() interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL