byron

package
v0.103.2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 8 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
	Header *ByronEpochBoundaryBlockHeader
	Body   []common.Blake2b224
	Extra  []interface{}
}

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 (b *ByronEpochBoundaryBlock) Hash() string

func (*ByronEpochBoundaryBlock) IssuerVkey

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

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

type ByronEpochBoundaryBlockHeader

type ByronEpochBoundaryBlockHeader struct {
	cbor.StructAsArray
	cbor.DecodeStoreCbor

	ProtocolMagic uint32
	PrevBlock     common.Blake2b256
	BodyProof     interface{}
	ConsensusData struct {
		cbor.StructAsArray
		Epoch      uint64
		Difficulty struct {
			cbor.StructAsArray
			Value uint64
		}
	}
	ExtraData interface{}
	// 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) 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
	BlockVersionData ByronGenesisBlockVersionData
	FtsSeed          string
	ProtocolConsts   ByronGenesisProtocolConsts
	StartTime        int
	BootStakeholders map[string]int
	HeavyDelegation  map[string]ByronGenesisHeavyDelegation
	NonAvvmBalances  any
	VssCerts         map[string]ByronGenesisVssCert
}

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)

type ByronGenesisBlockVersionData added in v0.96.0

type ByronGenesisBlockVersionData struct {
	HeavyDelThd       int `json:",string"`
	MaxBlockSize      int `json:",string"`
	MaxHeaderSize     int `json:",string"`
	MaxProposalSize   int `json:",string"`
	MaxTxSize         int `json:",string"`
	MpcThd            int `json:",string"`
	ScriptVersion     int
	SlotDuration      int `json:",string"`
	SoftforkRule      ByronGenesisBlockVersionDataSoftforkRule
	TxFeePolicy       ByronGenesisBlockVersionDataTxFeePolicy
	UnlockStakeEpoch  uint64 `json:",string"`
	UpdateImplicit    int    `json:",string"`
	UpdateProposalThd int    `json:",string"`
	UpdateVoteThd     int    `json:",string"`
}

type ByronGenesisBlockVersionDataSoftforkRule added in v0.96.0

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

type ByronGenesisBlockVersionDataTxFeePolicy added in v0.96.0

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

type ByronGenesisHeavyDelegation added in v0.96.0

type ByronGenesisHeavyDelegation struct {
	Cert       string
	DelegatePk string
	IssuerPk   string
	Omega      int
}

type ByronGenesisProtocolConsts added in v0.96.0

type ByronGenesisProtocolConsts struct {
	K             int
	ProtocolMagic int
	VssMinTTL     int
	VssMaxTTL     int
}

type ByronGenesisVssCert added in v0.96.0

type ByronGenesisVssCert struct {
	ExpiryEpoch int
	Signature   string
	SigningKey  string
	VssKey      string
}

type ByronMainBlock

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

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() string

func (*ByronMainBlock) IssuerVkey

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

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

type ByronMainBlockBody

type ByronMainBlockBody struct {
	cbor.StructAsArray
	cbor.DecodeStoreCbor
	// TODO: split this to its own type
	TxPayload []struct {
		cbor.StructAsArray
		Transaction ByronTransaction
		// TODO: figure out what this field actually is
		Twit []cbor.Value
	}
	SscPayload cbor.Value
	DlgPayload []interface{}
	UpdPayload ByronUpdatePayload
}

func (*ByronMainBlockBody) UnmarshalCBOR

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

type ByronMainBlockHeader

type ByronMainBlockHeader struct {
	cbor.StructAsArray
	cbor.DecodeStoreCbor

	ProtocolMagic uint32
	PrevBlock     common.Blake2b256
	BodyProof     interface{}
	ConsensusData struct {
		cbor.StructAsArray
		// [slotid, pubkey, difficulty, blocksig]
		SlotId struct {
			cbor.StructAsArray
			Epoch uint64
			Slot  uint16
		}
		PubKey     []byte
		Difficulty struct {
			cbor.StructAsArray
			Unknown uint64
		}
		BlockSig []interface{}
	}
	ExtraData struct {
		cbor.StructAsArray
		BlockVersion    ByronBlockVersion
		SoftwareVersion ByronSoftwareVersion
		Attributes      interface{}
		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 (h *ByronMainBlockHeader) Hash() string

func (*ByronMainBlockHeader) IssuerVkey

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

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 (t *ByronTransaction) Hash() string

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(data []byte) error

func (*ByronTransaction) Utxorpc

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

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

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) UnmarshalCBOR

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

func (ByronTransactionInput) Utxorpc

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

type ByronTransactionOutput

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

func (ByronTransactionOutput) Address

func (ByronTransactionOutput) Amount

func (o ByronTransactionOutput) Amount() uint64

func (ByronTransactionOutput) Assets

func (ByronTransactionOutput) Datum

func (ByronTransactionOutput) DatumHash

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

func (*ByronTransactionOutput) UnmarshalCBOR

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

func (ByronTransactionOutput) Utxorpc

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(data []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