mirror of
https://github.com/luxfi/runtime.git
synced 2026-07-27 06:54:56 +00:00
decomplect: rip NetworkUpgrades interface (14 always-true predicates) from Runtime + VMContext
This commit is contained in:
-30
@@ -94,9 +94,6 @@ type Runtime struct {
|
||||
// Sender is the canonical warp sender
|
||||
Sender warp.Sender
|
||||
|
||||
// NetworkUpgrades contains upgrade activation times
|
||||
NetworkUpgrades NetworkUpgrades
|
||||
|
||||
// Lock for thread-safe access to runtime fields
|
||||
Lock sync.RWMutex
|
||||
}
|
||||
@@ -139,25 +136,6 @@ type SharedMemory = atomic.SharedMemory
|
||||
// Matches warp.Signer interface exactly.
|
||||
type WarpSigner = warp.Signer
|
||||
|
||||
// NetworkUpgrades contains network upgrade activation times.
|
||||
// Matches upgrade.Config methods exactly.
|
||||
type NetworkUpgrades interface {
|
||||
IsApricotPhase1Activated(timestamp time.Time) bool
|
||||
IsApricotPhase2Activated(timestamp time.Time) bool
|
||||
IsApricotPhase3Activated(timestamp time.Time) bool
|
||||
IsApricotPhase4Activated(timestamp time.Time) bool
|
||||
IsApricotPhase5Activated(timestamp time.Time) bool
|
||||
IsApricotPhasePre6Activated(timestamp time.Time) bool
|
||||
IsApricotPhase6Activated(timestamp time.Time) bool
|
||||
IsApricotPhasePost6Activated(timestamp time.Time) bool
|
||||
IsBanffActivated(timestamp time.Time) bool
|
||||
IsCortinaActivated(timestamp time.Time) bool
|
||||
IsDurangoActivated(timestamp time.Time) bool
|
||||
IsEtnaActivated(timestamp time.Time) bool
|
||||
IsFortunaActivated(timestamp time.Time) bool
|
||||
IsGraniteActivated(timestamp time.Time) bool
|
||||
}
|
||||
|
||||
// VMContext is an interface that VM contexts must implement
|
||||
// This allows different context types (node, plugin, etc.) to be used interchangeably
|
||||
type VMContext interface {
|
||||
@@ -176,7 +154,6 @@ type VMContext interface {
|
||||
GetBCLookup() BCLookup
|
||||
GetWarpSigner() WarpSigner
|
||||
GetSender() warp.Sender
|
||||
GetNetworkUpgrades() NetworkUpgrades
|
||||
}
|
||||
|
||||
// IDs holds the IDs for runtime context
|
||||
@@ -312,13 +289,6 @@ func (r *Runtime) GetSender() warp.Sender {
|
||||
return r.Sender
|
||||
}
|
||||
|
||||
func (r *Runtime) GetNetworkUpgrades() NetworkUpgrades {
|
||||
if r == nil {
|
||||
return nil
|
||||
}
|
||||
return r.NetworkUpgrades
|
||||
}
|
||||
|
||||
// Ensure *Runtime implements VMContext at compile time
|
||||
var _ VMContext = (*Runtime)(nil)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user