Files
precompile/modules/module.go
T
zeekay acd2aaf533 feat: rename module to github.com/luxfi/precompile
BREAKING CHANGE: Module renamed from precompiles to precompile (singular)

- Remove lattice/v6 indirect dependency
- Exclude lattice/v6 versions to prevent transitive imports
- Only lattice/v7 is used now
2025-12-31 06:28:04 +00:00

38 lines
1005 B
Go

// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package modules
import (
"bytes"
"github.com/luxfi/geth/common"
"github.com/luxfi/precompile/contract"
)
type Module struct {
// ConfigKey is the key used in json config files to specify this precompile config.
ConfigKey string
// Address returns the address where the stateful precompile is accessible.
Address common.Address
// Contract returns a thread-safe singleton that can be used as the StatefulPrecompiledContract when
// this config is enabled.
Contract contract.StatefulPrecompiledContract
// Configurator is used to configure the stateful precompile when the config is enabled.
contract.Configurator
}
type moduleArray []Module
func (u moduleArray) Len() int {
return len(u)
}
func (u moduleArray) Swap(i, j int) {
u[i], u[j] = u[j], u[i]
}
func (m moduleArray) Less(i, j int) bool {
return bytes.Compare(m[i].Address.Bytes(), m[j].Address.Bytes()) < 0
}