genesis

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetInitialState

type AssetInitialState struct {
	FixedCap    []GenesisHolder
	VariableCap []GenesisOwners
}

AssetInitialState describes the initial state of an asset

type Genesis

type Genesis struct {
	Txs []*GenesisAsset `serialize:"true"`
}

Genesis represents the genesis state of the XVM

func NewGenesis

func NewGenesis(
	networkID uint32,
	genesisData map[string]GenesisAssetDefinition,
	genesisCodec txs.Codec,
) (*Genesis, error)

NewGenesis creates a new Genesis from genesis data.

The genesisCodec is the wire codec used to compute deterministic per-fx output bytes for the InitialState.Sort canonicalization step. It must already be wired through a Parser (see luxfi/proto/x/txs.NewParser) so that fx-owned output types (secp256k1fx.TransferOutput, secp256k1fx.MintOutput) are register-resolvable before Marshal is called.

Wave 1A of the codec rip (#101): the codec is now an injected dependency rather than constructed inline — proto/x/genesis no longer carries any github.com/luxfi/codec import.

func (*Genesis) Bytes

func (g *Genesis) Bytes(genesisCodec txs.Codec) ([]byte, error)

Bytes serializes the Genesis to bytes using the supplied genesis codec. The codec must accept Genesis and all its transitively referenced fx-owned types (see NewGenesis godoc).

Wave 1A: the genesisCodec is now an injected dependency, supplied by the caller's Parser.GenesisCodec().

type GenesisAsset

type GenesisAsset struct {
	Alias             string `serialize:"true"`
	txs.CreateAssetTx `serialize:"true"`
}

GenesisAsset represents an asset in the genesis block

func (*GenesisAsset) Compare

func (g *GenesisAsset) Compare(other *GenesisAsset) int

Compare implements ordering.Sortable for GenesisAsset

type GenesisAssetDefinition

type GenesisAssetDefinition struct {
	Name         string
	Symbol       string
	Denomination byte
	InitialState AssetInitialState
	Memo         []byte
}

GenesisAssetDefinition describes a genesis asset and its initial state

type GenesisHolder

type GenesisHolder struct {
	Amount  uint64
	Address string
}

GenesisHolder describes how much asset is owned by an address

type GenesisOwners

type GenesisOwners struct {
	Threshold uint32
	Minters   []string
}

GenesisOwners describes who can perform an action

Jump to

Keyboard shortcuts

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