test

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2024 License: BSD-3-Clause Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinStakingDuration = 24 * time.Hour
	ValidatorWeight    = 2 * units.KiloAvax
	PreFundedBalance   = 100 * ValidatorWeight
	TxFee              = uint64(100)
)
View Source
const (
	PhaseFirst = PhaseSunrise
	PhaseLast  = PhaseBerlin
)

Variables

View Source
var (
	AVAXAssetID  = ids.ID{'C', 'A', 'M'}
	OtherAssetID = ids.ID{'O', 'T', 'H', 'E', 'R'}

	GenesisTime             = time.Date(1997, 1, 1, 0, 0, 0, 0, time.UTC)
	LatestPhaseTime         = GenesisTime.Add(time.Second * 10000)
	ValidatorStartTime      = GenesisTime
	ValidatorEndTime        = GenesisTime.Add(10 * MinStakingDuration)
	GenesisTimestamp        = uint64(GenesisTime.Unix())
	ValidatorStartTimestamp = uint64(ValidatorStartTime.Unix())
	ValidatorEndTimestamp   = uint64(ValidatorEndTime.Unix())
)
View Source
var (
	Keys             []*secp256k1.PrivateKey
	KeysBech32       []string
	FundedKeys       []*secp256k1.PrivateKey
	FundedKeysBech32 []string
	FundedNodeKeys   []*secp256k1.PrivateKey
	FundedNodeIDs    []ids.NodeID
)

Functions

func Clock

func Clock() *mockable.Clock

func ClockWithTime

func ClockWithTime(time time.Time) *mockable.Clock

func Config

func Config(t *testing.T, phase Phase) *config.Config

func Context

func Context(t *testing.T) *snow.Context

func ContextWithSharedMemory

func ContextWithSharedMemory(t *testing.T, db database.Database) *snow.Context

func Fx

func Fx(t *testing.T, clk *mockable.Clock, log logging.Logger, isBootstrapped bool) fx.Fx

func Genesis

func Genesis(t *testing.T, avaxAssetID ids.ID, caminoGenesisConfig api.Camino, additionalUTXOs []api.UTXO) []byte

func PhaseName

func PhaseName(t *testing.T, phase Phase) string

func PhaseTime

func PhaseTime(t *testing.T, phase Phase, cfg *config.Config) time.Time

Types

type Phase

type Phase int
const (
	PhaseApricot5 Phase = 0 // avax
	PhaseBanff    Phase = 1 // avax, included into Sunrise phase
	PhaseSunrise  Phase = 1
	PhaseAthens   Phase = 2
	PhaseCortina  Phase = 3 // avax, included into Berlin phase
	PhaseBerlin   Phase = 3
	PhaseCairo    Phase = 4
)

Camino phases must go in consecutive order

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL