github.com/MetalBlockchain/metalgo@v1.11.9/vms/platformvm/upgrade/config.go (about)

     1  // Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
     2  // See the file LICENSE for licensing terms.
     3  
     4  package upgrade
     5  
     6  import "time"
     7  
     8  type Config struct {
     9  	// Time of the AP3 network upgrade
    10  	ApricotPhase3Time time.Time
    11  
    12  	// Time of the AP5 network upgrade
    13  	ApricotPhase5Time time.Time
    14  
    15  	// Time of the Banff network upgrade
    16  	BanffTime time.Time
    17  
    18  	// Time of the Cortina network upgrade
    19  	CortinaTime time.Time
    20  
    21  	// Time of the Durango network upgrade
    22  	DurangoTime time.Time
    23  
    24  	// Time of the E network upgrade
    25  	EUpgradeTime time.Time
    26  }
    27  
    28  func (c *Config) IsApricotPhase3Activated(timestamp time.Time) bool {
    29  	return !timestamp.Before(c.ApricotPhase3Time)
    30  }
    31  
    32  func (c *Config) IsApricotPhase5Activated(timestamp time.Time) bool {
    33  	return !timestamp.Before(c.ApricotPhase5Time)
    34  }
    35  
    36  func (c *Config) IsBanffActivated(timestamp time.Time) bool {
    37  	return !timestamp.Before(c.BanffTime)
    38  }
    39  
    40  func (c *Config) IsCortinaActivated(timestamp time.Time) bool {
    41  	return !timestamp.Before(c.CortinaTime)
    42  }
    43  
    44  func (c *Config) IsDurangoActivated(timestamp time.Time) bool {
    45  	return !timestamp.Before(c.DurangoTime)
    46  }
    47  
    48  func (c *Config) IsEActivated(timestamp time.Time) bool {
    49  	return !timestamp.Before(c.EUpgradeTime)
    50  }