byron

package
v0.94.2 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 5 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 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 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 []interface{}
}

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 struct {
			cbor.StructAsArray
			Major   uint16
			Minor   uint16
			Unknown uint8
		}
		SoftwareVersion struct {
			cbor.StructAsArray
			Name    string
			Unknown uint32
		}
		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 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) ProtocolParametersUpdate

func (t *ByronTransaction) ProtocolParametersUpdate() map[common.Blake2b224]any

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

Jump to

Keyboard shortcuts

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