Documentation
¶
Overview ¶
Defines the stateless interface for unmarshalling an arbitrary config of a precompile
TODO: replace with gomock
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNoopStatefulPrecompileConfig ¶
func NewNoopStatefulPrecompileConfig() *noopStatefulPrecompileConfig
Types ¶
type Config ¶
type Config interface { // Key returns the unique key for the stateful precompile. Key() string // Timestamp returns the timestamp at which this stateful precompile should be enabled. // 1) 0 indicates that the precompile should be enabled from genesis. // 2) n indicates that the precompile should be enabled in the first block with timestamp >= [n]. // 3) nil indicates that the precompile is never enabled. Timestamp() *big.Int // IsDisabled returns true if this network upgrade should disable the precompile. IsDisabled() bool // Equal returns true if the provided argument configures the same precompile with the same parameters. Equal(Config) bool // Verify is called on startup and an error is treated as fatal. Configure can assume the Config has passed verification. Verify() error }
StatefulPrecompileConfig defines the interface for a stateful precompile to be enabled via a network upgrade.
type Upgrade ¶
type Upgrade struct { BlockTimestamp *big.Int `json:"blockTimestamp"` Disable bool `json:"disable,omitempty"` }
Upgrade contains the timestamp for the upgrade along with a boolean [Disable]. If [Disable] is set, the upgrade deactivates the precompile and clears its storage.
func (*Upgrade) Equal ¶
Equal returns true iff [other] has the same blockTimestamp and has the same on value for the Disable flag.
func (*Upgrade) IsDisabled ¶
IsDisabled returns true if the network upgrade deactivates the precompile.
Click to show internal directories.
Click to hide internal directories.