Files
coreth/precompile/modules/module.go
zeekay dd02f9cc9b chore: remove local replace directive and update vm dependency
- Update github.com/luxfi/vm v1.0.1 → v1.0.2
- Remove local replace directive for vm
- Use published package versions for reproducible builds
2026-01-03 07:11:08 -08:00

38 lines
1012 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/coreth/precompile/contract"
"github.com/luxfi/geth/common"
)
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 (u moduleArray) Less(i, j int) bool {
return bytes.Compare(u[i].Address.Bytes(), u[j].Address.Bytes()) < 0
}