byron

package
v0.132.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const (
	EraIdByron   = 0
	EraNameByron = "Byron"

	BlockTypeByronEbb  = 0
	BlockTypeByronMain = 1

	BlockHeaderTypeByron = 0

	TxTypeByron = 0

	ByronSlotsPerEpoch = 21600
)

Variables

View Source
var EraByron = common.Era{
	Id:   EraIdByron,
	Name: EraNameByron,
}

Functions

This section is empty.

Types

type ByronBlockVersion added in v0.100.0

type ByronBlockVersion struct {
	cbor.StructAsArray
	Major   uint16
	Minor   uint16
	Unknown uint8
}

type ByronEpochBoundaryBlock

type ByronEpochBoundaryBlock struct {
	cbor.StructAsArray
	cbor.DecodeStoreCbor
	BlockHeader *ByronEpochBoundaryBlockHeader
	Body        []common.Blake2b224
	Extra       []any
}

func NewByronEpochBoundaryBlockFromCbor

func NewByronEpochBoundaryBlockFromCbor(
	data []byte,
) (*ByronEpochBoundaryBlock, error)

func (*ByronEpochBoundaryBlock) BlockBodySize

func (b *ByronEpochBoundaryBlock) BlockBodySize() uint64

func (*ByronEpochBoundaryBlock) BlockNumber

func (b *ByronEpochBoundaryBlock) BlockNumber() uint64

func (*ByronEpochBoundaryBlock) Era

func (*ByronEpochBoundaryBlock) Hash

func (*ByronEpochBoundaryBlock) Header

func (*ByronEpochBoundaryBlock) IssuerVkey

func (b *ByronEpochBoundaryBlock) IssuerVkey() common.IssuerVkey

func (*ByronEpochBoundaryBlock) PrevHash added in v0.105.0

func (*ByronEpochBoundaryBlock) SlotNumber

func (b *ByronEpochBoundaryBlock) SlotNumber() uint64

func (*ByronEpochBoundaryBlock) Transactions

func (b *ByronEpochBoundaryBlock) Transactions() []common.Transaction

func (ByronEpochBoundaryBlock) Type added in v0.94.0

func (*ByronEpochBoundaryBlock) UnmarshalCBOR

func (b *ByronEpochBoundaryBlock) UnmarshalCBOR(cborData []byte) error

func (*ByronEpochBoundaryBlock) Utxorpc

func (b *ByronEpochBoundaryBlock) Utxorpc() (*utxorpc.Block, error)

type ByronEpochBoundaryBlockHeader

type ByronEpochBoundaryBlockHeader struct {
	cbor.StructAsArray
	cbor.DecodeStoreCbor

	ProtocolMagic uint32
	PrevBlock     common.Blake2b256
	BodyProof     any
	ConsensusData struct {
		cbor.StructAsArray
		Epoch      uint64
		Difficulty struct {
			cbor.StructAsArray
			Value uint64
		}
	}
	ExtraData any
	// contains filtered or unexported fields
}

func NewByronEpochBoundaryBlockHeaderFromCbor

func NewByronEpochBoundaryBlockHeaderFromCbor(
	data []byte,
) (*ByronEpochBoundaryBlockHeader, error)

func (*ByronEpochBoundaryBlockHeader) BlockBodySize

func (h *ByronEpochBoundaryBlockHeader) BlockBodySize() uint64

func (*ByronEpochBoundaryBlockHeader) BlockNumber

func (h *ByronEpochBoundaryBlockHeader) BlockNumber() uint64

func (*ByronEpochBoundaryBlockHeader) Era

func (*ByronEpochBoundaryBlockHeader) Hash

func (*ByronEpochBoundaryBlockHeader) IssuerVkey

func (*ByronEpochBoundaryBlockHeader) PrevHash added in v0.105.0

func (*ByronEpochBoundaryBlockHeader) SlotNumber

func (h *ByronEpochBoundaryBlockHeader) SlotNumber() uint64

func (*ByronEpochBoundaryBlockHeader) UnmarshalCBOR

func (h *ByronEpochBoundaryBlockHeader) UnmarshalCBOR(cborData []byte) error

type ByronGenesis added in v0.96.0

type ByronGenesis struct {
	AvvmDistr        map[string]string                      `json:"avvmDistr"`
	BlockVersionData ByronGenesisBlockVersionData           `json:"blockVersionData"`
	FtsSeed          string                                 `json:"ftsSeed"`
	ProtocolConsts   ByronGenesisProtocolConsts             `json:"protocolConsts"`
	StartTime        int                                    `json:"startTime"`
	BootStakeholders map[string]int                         `json:"bootStakeholders"`
	HeavyDelegation  map[string]ByronGenesisHeavyDelegation `json:"heavyDelegation"`
	NonAvvmBalances  map[string]string                      `json:"nonAvvmBalances"`
	VssCerts         map[string]ByronGenesisVssCert         `json:"vssCerts"`
}

func NewByronGenesisFromFile added in v0.96.0

func NewByronGenesisFromFile(path string) (ByronGenesis, error)

func NewByronGenesisFromReader added in v0.96.0

func NewByronGenesisFromReader(r io.Reader) (ByronGenesis, error)

func (*ByronGenesis) GenesisUtxos added in v0.107.0

func (g *ByronGenesis) GenesisUtxos() ([]common.Utxo, error)

type ByronGenesisBlockVersionData added in v0.96.0

type ByronGenesisBlockVersionData struct {
	HeavyDelThd       int                                      `json:"heavyDelThd,string"`
	MaxBlockSize      int                                      `json:"maxBlockSize,string"`
	MaxHeaderSize     int                                      `json:"maxHeaderSize,string"`
	MaxProposalSize   int                                      `json:"maxProposalSize,string"`
	MaxTxSize         int                                      `json:"maxTxSize,string"`
	MpcThd            int                                      `json:"mpcThd,string"`
	ScriptVersion     int                                      `json:"scriptVersion"`
	SlotDuration      int                                      `json:"slotDuration,string"`
	SoftforkRule      ByronGenesisBlockVersionDataSoftforkRule `json:"softforkRule"`
	TxFeePolicy       ByronGenesisBlockVersionDataTxFeePolicy  `json:"txFeePolicy"`
	UnlockStakeEpoch  uint64                                   `json:"unlockStakeEpoch,string"`
	UpdateImplicit    int                                      `json:"updateImplicit,string"`
	UpdateProposalThd int                                      `json:"updateProposalThd,string"`
	UpdateVoteThd     int                                      `json:"updateVoteThd,string"`
}

type ByronGenesisBlockVersionDataSoftforkRule added in v0.96.0

type ByronGenesisBlockVersionDataSoftforkRule struct {
	InitThd      int `json:"initThd,string"`
	MinThd       int `json:"minThd,string"`
	ThdDecrement int `json:"thdDecrement,string"`
}

type ByronGenesisBlockVersionDataTxFeePolicy added in v0.96.0

type ByronGenesisBlockVersionDataTxFeePolicy struct {
	Multiplier int `json:"multiplier,string"`
	Summand    int `json:"summand,string"`
}

type ByronGenesisHeavyDelegation added in v0.96.0

type ByronGenesisHeavyDelegation struct {
	Cert       string `json:"cert"`
	DelegatePk string `json:"delegatePk"`
	IssuerPk   string `json:"issuerPk"`
	Omega      int    `json:"omega"`
}

type ByronGenesisProtocolConsts added in v0.96.0

type ByronGenesisProtocolConsts struct {
	K             int `json:"k"`
	ProtocolMagic int `json:"protocolMagic"`
	VssMinTTL     int `json:"vssMinTtl"`
	VssMaxTTL     int `json:"vssMaxTtl"`
}

type ByronGenesisVssCert added in v0.96.0

type ByronGenesisVssCert struct {
	ExpiryEpoch int    `json:"expiryEpoch"`
	Signature   string `json:"signature"`
	SigningKey  string `json:"signingKey"`
	VssKey      string `json:"vssKey"`
}

type ByronMainBlock

type ByronMainBlock struct {
	cbor.StructAsArray
	cbor.DecodeStoreCbor
	BlockHeader *ByronMainBlockHeader
	Body        ByronMainBlockBody
	Extra       []any
}

func NewByronMainBlockFromCbor

func NewByronMainBlockFromCbor(data []byte) (*ByronMainBlock, error)

func (*ByronMainBlock) BlockBodySize

func (b *ByronMainBlock) BlockBodySize() uint64

func (*ByronMainBlock) BlockNumber

func (b *ByronMainBlock) BlockNumber() uint64

func (*ByronMainBlock) Era

func (b *ByronMainBlock) Era() common.Era

func (*ByronMainBlock) Hash

func (b *ByronMainBlock) Hash() common.Blake2b256

func (*ByronMainBlock) Header

func (b *ByronMainBlock) Header() common.BlockHeader

func (*ByronMainBlock) IssuerVkey

func (b *ByronMainBlock) IssuerVkey() common.IssuerVkey

func (*ByronMainBlock) PrevHash added in v0.105.0

func (b *ByronMainBlock) PrevHash() common.Blake2b256

func (*ByronMainBlock) SlotNumber

func (b *ByronMainBlock) SlotNumber() uint64

func (*ByronMainBlock) Transactions

func (b *ByronMainBlock) Transactions() []common.Transaction

func (ByronMainBlock) Type added in v0.94.0

func (ByronMainBlock) Type() int

func (*ByronMainBlock) UnmarshalCBOR

func (b *ByronMainBlock) UnmarshalCBOR(cborData []byte) error

func (*ByronMainBlock) Utxorpc

func (b *ByronMainBlock) Utxorpc() (*utxorpc.Block, error)

type ByronMainBlockBody

type ByronMainBlockBody struct {
	cbor.StructAsArray
	cbor.DecodeStoreCbor
	// TODO: split this to its own type (#853)
	TxPayload []struct {
		cbor.StructAsArray
		Transaction ByronTransaction
		// TODO: properly decode TX witnesses (#853)
		Twit []cbor.Value
	}
	SscPayload cbor.Value
	DlgPayload []any
	UpdPayload ByronUpdatePayload
}

func (*ByronMainBlockBody) UnmarshalCBOR

func (b *ByronMainBlockBody) UnmarshalCBOR(cborData []byte) error

type ByronMainBlockHeader

type ByronMainBlockHeader struct {
	cbor.StructAsArray
	cbor.DecodeStoreCbor

	ProtocolMagic uint32
	PrevBlock     common.Blake2b256
	BodyProof     any
	ConsensusData struct {
		cbor.StructAsArray
		// [slotid, pubkey, difficulty, blocksig]
		SlotId struct {
			cbor.StructAsArray
			Epoch uint64
			Slot  uint16
		}
		PubKey     []byte
		Difficulty struct {
			cbor.StructAsArray
			Value uint64
		}
		BlockSig []any
	}
	ExtraData struct {
		cbor.StructAsArray
		BlockVersion    ByronBlockVersion
		SoftwareVersion ByronSoftwareVersion
		Attributes      any
		ExtraProof      common.Blake2b256
	}
	// contains filtered or unexported fields
}

func NewByronMainBlockHeaderFromCbor

func NewByronMainBlockHeaderFromCbor(
	data []byte,
) (*ByronMainBlockHeader, error)

func (*ByronMainBlockHeader) BlockBodySize

func (h *ByronMainBlockHeader) BlockBodySize() uint64

func (*ByronMainBlockHeader) BlockNumber

func (h *ByronMainBlockHeader) BlockNumber() uint64

func (*ByronMainBlockHeader) Era

func (h *ByronMainBlockHeader) Era() common.Era

func (*ByronMainBlockHeader) Hash

func (*ByronMainBlockHeader) IssuerVkey

func (h *ByronMainBlockHeader) IssuerVkey() common.IssuerVkey

func (*ByronMainBlockHeader) PrevHash added in v0.105.0

func (h *ByronMainBlockHeader) PrevHash() common.Blake2b256

func (*ByronMainBlockHeader) SlotNumber

func (h *ByronMainBlockHeader) SlotNumber() uint64

func (*ByronMainBlockHeader) UnmarshalCBOR

func (h *ByronMainBlockHeader) UnmarshalCBOR(cborData []byte) error

type ByronSoftwareVersion added in v0.100.0

type ByronSoftwareVersion struct {
	cbor.StructAsArray
	Name    string
	Version uint32
}

type ByronTransaction

type ByronTransaction struct {
	cbor.StructAsArray
	cbor.DecodeStoreCbor

	TxInputs   []ByronTransactionInput
	TxOutputs  []ByronTransactionOutput
	Attributes *cbor.LazyValue
	// contains filtered or unexported fields
}

func NewByronTransactionFromCbor

func NewByronTransactionFromCbor(data []byte) (*ByronTransaction, error)

func (*ByronTransaction) AssetMint

func (*ByronTransaction) AuxDataHash

func (t *ByronTransaction) AuxDataHash() *common.Blake2b256

func (*ByronTransaction) Certificates

func (t *ByronTransaction) Certificates() []common.Certificate

func (*ByronTransaction) Collateral

func (t *ByronTransaction) Collateral() []common.TransactionInput

func (*ByronTransaction) CollateralReturn

func (t *ByronTransaction) CollateralReturn() common.TransactionOutput

func (*ByronTransaction) Consumed

func (t *ByronTransaction) Consumed() []common.TransactionInput

func (*ByronTransaction) CurrentTreasuryValue

func (t *ByronTransaction) CurrentTreasuryValue() int64

func (*ByronTransaction) Donation

func (t *ByronTransaction) Donation() uint64

func (*ByronTransaction) Fee

func (t *ByronTransaction) Fee() uint64

func (*ByronTransaction) Hash

func (*ByronTransaction) Inputs

func (*ByronTransaction) IsValid

func (t *ByronTransaction) IsValid() bool

func (*ByronTransaction) Metadata

func (t *ByronTransaction) Metadata() *cbor.LazyValue

func (*ByronTransaction) Outputs

func (t *ByronTransaction) Outputs() []common.TransactionOutput

func (*ByronTransaction) Produced

func (t *ByronTransaction) Produced() []common.Utxo

func (*ByronTransaction) ProposalProcedures

func (t *ByronTransaction) ProposalProcedures() []common.ProposalProcedure

func (*ByronTransaction) ProtocolParameterUpdates added in v0.95.0

func (t *ByronTransaction) ProtocolParameterUpdates() (uint64, map[common.Blake2b224]common.ProtocolParameterUpdate)

func (*ByronTransaction) ReferenceInputs

func (t *ByronTransaction) ReferenceInputs() []common.TransactionInput

func (*ByronTransaction) RequiredSigners

func (t *ByronTransaction) RequiredSigners() []common.Blake2b224

func (*ByronTransaction) ScriptDataHash

func (t *ByronTransaction) ScriptDataHash() *common.Blake2b256

func (*ByronTransaction) TTL

func (t *ByronTransaction) TTL() uint64

func (*ByronTransaction) TotalCollateral

func (t *ByronTransaction) TotalCollateral() uint64

func (ByronTransaction) Type added in v0.94.0

func (ByronTransaction) Type() int

func (*ByronTransaction) UnmarshalCBOR

func (t *ByronTransaction) UnmarshalCBOR(cborData []byte) error

func (*ByronTransaction) Utxorpc

func (t *ByronTransaction) Utxorpc() (*utxorpc.Tx, error)

func (*ByronTransaction) ValidityIntervalStart

func (t *ByronTransaction) ValidityIntervalStart() uint64

func (*ByronTransaction) VotingProcedures

func (t *ByronTransaction) VotingProcedures() common.VotingProcedures

func (*ByronTransaction) Withdrawals

func (t *ByronTransaction) Withdrawals() map[*common.Address]uint64

func (ByronTransaction) Witnesses added in v0.110.0

type ByronTransactionInput

type ByronTransactionInput struct {
	cbor.StructAsArray
	TxId        common.Blake2b256
	OutputIndex uint32
}

func NewByronTransactionInput

func NewByronTransactionInput(hash string, idx int) ByronTransactionInput

func (ByronTransactionInput) Id

func (ByronTransactionInput) Index

func (i ByronTransactionInput) Index() uint32

func (ByronTransactionInput) MarshalJSON

func (i ByronTransactionInput) MarshalJSON() ([]byte, error)

func (ByronTransactionInput) String

func (i ByronTransactionInput) String() string

func (ByronTransactionInput) ToPlutusData added in v0.129.0

func (i ByronTransactionInput) ToPlutusData() data.PlutusData

func (*ByronTransactionInput) UnmarshalCBOR

func (i *ByronTransactionInput) UnmarshalCBOR(data []byte) error

func (ByronTransactionInput) Utxorpc

func (i ByronTransactionInput) Utxorpc() (*utxorpc.TxInput, error)

type ByronTransactionOutput

type ByronTransactionOutput struct {
	cbor.StructAsArray
	cbor.DecodeStoreCbor
	OutputAddress common.Address `json:"address"`
	OutputAmount  uint64         `json:"amount"`
}

func NewByronTransactionOutputFromCbor added in v0.117.1

func NewByronTransactionOutputFromCbor(
	data []byte,
) (*ByronTransactionOutput, error)

func (ByronTransactionOutput) Address

func (ByronTransactionOutput) Amount

func (o ByronTransactionOutput) Amount() uint64

func (ByronTransactionOutput) Assets

func (ByronTransactionOutput) Datum

func (o ByronTransactionOutput) Datum() *common.Datum

func (ByronTransactionOutput) DatumHash

func (o ByronTransactionOutput) DatumHash() *common.Blake2b256

func (ByronTransactionOutput) ScriptRef added in v0.126.0

func (o ByronTransactionOutput) ScriptRef() common.Script

func (ByronTransactionOutput) ToPlutusData added in v0.130.0

func (o ByronTransactionOutput) ToPlutusData() data.PlutusData

func (*ByronTransactionOutput) UnmarshalCBOR

func (o *ByronTransactionOutput) UnmarshalCBOR(data []byte) error

func (ByronTransactionOutput) Utxorpc

func (o ByronTransactionOutput) Utxorpc() (*utxorpc.TxOutput, error)

type ByronUpdatePayload added in v0.100.0

type ByronUpdatePayload struct {
	cbor.StructAsArray
	Proposals []ByronUpdateProposal
	Votes     []any
}

type ByronUpdateProposal added in v0.100.0

type ByronUpdateProposal struct {
	cbor.DecodeStoreCbor
	cbor.StructAsArray
	BlockVersion    ByronBlockVersion
	BlockVersionMod ByronUpdateProposalBlockVersionMod
	SoftwareVersion ByronSoftwareVersion
	Data            any
	Attributes      any
	From            []byte
	Signature       []byte
}

func (*ByronUpdateProposal) UnmarshalCBOR added in v0.100.0

func (p *ByronUpdateProposal) UnmarshalCBOR(cborData []byte) error

type ByronUpdateProposalBlockVersionMod added in v0.100.0

type ByronUpdateProposalBlockVersionMod struct {
	cbor.StructAsArray
	ScriptVersion     []uint16
	SlotDuration      []uint64
	MaxBlockSize      []uint64
	MaxHeaderSize     []uint64
	MaxTxSize         []uint64
	MaxProposalSize   []uint64
	MpcThd            []uint64
	HeavyDelThd       []uint64
	UpdateVoteThd     []uint64
	UpdateProposalThd []uint64
	UpdateImplicit    []uint64
	SoftForkRule      []any
	TxFeePolicy       []any
	UnlockStakeEpoch  []uint64
}

Jump to

Keyboard shortcuts

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