antelope

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PrunableDataVariant = eos.NewVariantDefinition([]eos.VariantType{
	{Name: "full_legacy", Type: (*PackedTransactionPrunableFullLegacy)(nil)},
	{Name: "none", Type: (*PackedTransactionPrunableNone)(nil)},
	{Name: "partial", Type: (*PackedTransactionPrunablePartial)(nil)},
	{Name: "full", Type: (*PackedTransactionPrunableFull)(nil)},
})
View Source
var SegmentVariant = eos.NewVariantDefinition([]eos.VariantType{
	{Name: "digest", Type: eos.Checksum256{}},
	{Name: "bytes", Type: eos.HexBytes{}},
})
View Source
var TransactionVariant = eos.NewVariantDefinition([]eos.VariantType{
	{Name: "transaction_id", Type: eos.Checksum256{}},
	{Name: "packed_transaction", Type: (*PackedTransaction)(nil)},
})

Functions

func AccountDeltasToDEOS

func AccountDeltasToDEOS(deltas []AccountDelta) (out []*pbantelope.AccountDelta)

func AccountRAMDeltasToDEOS

func AccountRAMDeltasToDEOS(deltas []AccountDelta) (out []*pbantelope.AccountRAMDelta)

func ActionTraceToDEOS

func ActionTraceToDEOS(in *ActionTrace, execIndex uint32, opts ...antelope.ConversionOption) (out *pbantelope.ActionTrace, consoleTruncated bool)

func ActionTracesToDEOS

func ActionTracesToDEOS(actionTraces []*ActionTrace, opts ...antelope.ConversionOption) (out []*pbantelope.ActionTrace, someConsoleTruncated bool)

func FinalityDataToDEOS

func FinalityDataToDEOS(in *FinalityData) *pbantelope.FinalityData

func FinalizerPolicyToDEOS added in v1.5.0

func FinalizerPolicyToDEOS(in *FinalizerPolicy) *pbantelope.FinalizerPolicy

func PackedTransactionToDEOS

func PackedTransactionToDEOS(in *PackedTransaction) *pbantelope.PackedTransaction

func ProposerPolicyToDEOS added in v1.5.0

func ProposerPolicyToDEOS(in *ProposerPolicy) *pbantelope.ProposerPolicy

func SignaturesToDEOS

func SignaturesToDEOS(in []ecc.Signature) (out []string)

func TransactionReceiptToDEOS

func TransactionReceiptToDEOS(txReceipt *TransactionReceipt) *pbantelope.TransactionReceipt

func TransactionStatusToDEOS

func TransactionStatusToDEOS(in eos.TransactionStatus) pbantelope.TransactionStatus

func TransactionTraceToDEOS

func TransactionTraceToDEOS(logger *zap.Logger, in *TransactionTrace, opts ...antelope.ConversionOption) *pbantelope.TransactionTrace

Types

type AccountDelta

type AccountDelta struct {
	Account eos.AccountName `json:"account"`
	Delta   eos.Int64       `json:"delta"`
}

type ActionTrace

type ActionTrace struct {
	ActionOrdinal                          eos.Varuint32           `json:"action_ordinal"`
	CreatorActionOrdinal                   eos.Varuint32           `json:"creator_action_ordinal"`
	ClosestUnnotifiedAncestorActionOrdinal eos.Varuint32           `json:"closest_unnotified_ancestor_action_ordinal"`
	Receipt                                *eos.ActionTraceReceipt `json:"receipt,omitempty" eos:"optional"`
	Receiver                               eos.AccountName         `json:"receiver"`
	Action                                 *eos.Action             `json:"act"`
	ContextFree                            bool                    `json:"context_free"`
	ElapsedUs                              eos.Int64               `json:"elapsed"`
	Console                                eos.SafeString          `json:"console"`
	TransactionID                          eos.Checksum256         `json:"trx_id"`
	BlockNum                               uint32                  `json:"block_num"`
	BlockTime                              eos.BlockTimestamp      `json:"block_time"`
	ProducerBlockID                        eos.Checksum256         `json:"producer_block_id" eos:"optional"`
	AccountRAMDeltas                       []AccountDelta          `json:"account_ram_deltas"`
	// Added in 2.1.x
	// AccountDiskDeltas []AccountDelta `json:"account_disk_deltas"`
	Except    *eos.Except `json:"except,omitempty" eos:"optional"`
	ErrorCode *eos.Uint64 `json:"error_code,omitempty" eos:"optional"`
	// Added in 2.1.x
	ReturnValue eos.HexBytes `json:"return_value"`
}

ActionTrace

File hierarchy:

type FinalityData

type FinalityData struct {
	MajorVersion                         uint32             `json:"major_version"`
	MinorVersion                         uint32             `json:"minor_version"`
	ActiveFinalizerPolicyGeneration      uint32             `json:"active_finalizer_policy_generation"`
	ActionMroot                          eos.Checksum256    `json:"action_mroot"`
	ReversibleBlocksMroot                eos.Checksum256    `json:"reversible_blocks_mroot"`
	LatestQCClaimBlockNum                uint32             `json:"latest_qc_claim_block_num"`
	LatestQCClaimFinalityDigest          eos.Checksum256    `json:"latest_qc_claim_finality_digest"`
	LatestQCClaimTimestamp               eos.BlockTimestamp `json:"latest_qc_claim_timestamp"`
	BaseDigest                           eos.Checksum256    `json:"base_digest"`
	PendingFinalizerPolicy               *FinalizerPolicy   `json:"pending_finalizer_policy,omitempty" eos:"optional"`
	LastPendingFinalizerPolicyGeneration uint32             `json:"last_pending_finalizer_policy_generation"`
}

FinalityData

File hierarchy:

type FinalizerAuthority

type FinalizerAuthority struct {
	Description string `json:"description"`
	Weight      uint64 `json:"weight"`
	PublicKey   string `json:"public_key"`
}

type FinalizerPolicy

type FinalizerPolicy struct {
	Generation uint32                `json:"generation"`
	Threshold  uint64                `json:"threshold"`
	Finalizers []*FinalizerAuthority `json:"finalizers"`
}

type Hydrator

type Hydrator struct {
	// contains filtered or unexported fields
}

func NewHydrator

func NewHydrator(parentLogger *zap.Logger) *Hydrator

func (*Hydrator) DecodeFinalityData

func (h *Hydrator) DecodeFinalityData(input []byte) (*pbantelope.FinalityData, error)

func (*Hydrator) DecodeFinalizerPolicy added in v1.5.0

func (h *Hydrator) DecodeFinalizerPolicy(input []byte) (*pbantelope.FinalizerPolicy, error)

func (*Hydrator) DecodeProposerPolicy added in v1.5.0

func (h *Hydrator) DecodeProposerPolicy(input []byte) (*pbantelope.ProposerPolicy, error)

func (*Hydrator) DecodeTransactionTrace

func (h *Hydrator) DecodeTransactionTrace(input []byte, opts ...antelope.ConversionOption) (*pbantelope.TransactionTrace, error)

func (*Hydrator) HydrateBlock

func (h *Hydrator) HydrateBlock(block *pbantelope.Block, input []byte, version string) error

type LegacyBlockState

type LegacyBlockState struct {

	// From 'struct block_header_state_legacy_common'
	BlockNum                         uint32                         `json:"block_num"`
	DPoSProposedIrreversibleBlockNum uint32                         `json:"dpos_proposed_irreversible_blocknum"`
	DPoSIrreversibleBlockNum         uint32                         `json:"dpos_irreversible_blocknum"`
	ActiveSchedule                   *eos.ProducerAuthoritySchedule `json:"active_schedule"`
	BlockrootMerkle                  *eos.MerkleRoot                `json:"blockroot_merkle,omitempty"`
	ProducerToLastProduced           []eos.PairAccountNameBlockNum  `json:"producer_to_last_produced,omitempty"`
	ProducerToLastImpliedIRB         []eos.PairAccountNameBlockNum  `json:"producer_to_last_implied_irb,omitempty"`
	ValidBlockSigningAuthorityV2     *eos.BlockSigningAuthority     `json:"valid_block_signing_authority,omitempty"`
	ConfirmCount                     []uint8                        `json:"confirm_count,omitempty"`

	// From 'struct block_header_state_legacy'
	BlockID                   eos.Checksum256                   `json:"id"`
	Header                    *eos.SignedBlockHeader            `json:"header,omitempty"`
	PendingSchedule           *eos.PendingSchedule              `json:"pending_schedule"`
	ActivatedProtocolFeatures *eos.ProtocolFeatureActivationSet `json:"activated_protocol_features,omitempty" eos:"optional"`
	AdditionalSignatures      []ecc.Signature                   `json:"additional_signatures"`

	SignedBlock        *SignedBlock    `json:"block,omitempty" eos:"optional"`
	Validated          bool            `json:"validated"`
	ActionMrootSavanna eos.Checksum256 `json:"action_mroot_savanna,omitempty" eos:"optional"`
}

LegacyBlockState

File hierarchy:

type PackedTransaction

type PackedTransaction struct {
	Compression       eos.CompressionType `json:"compression"`
	PrunableData      *PrunableData       `json:"prunable_data"`
	PackedTransaction eos.HexBytes        `json:"packed_trx"`
}

type PackedTransactionPrunableFull

type PackedTransactionPrunableFull struct {
	Signatures          []ecc.Signature `json:"signatures"`
	ContextFreeSegments []eos.HexBytes  `json:"context_free_segments"`
}

type PackedTransactionPrunableFullLegacy

type PackedTransactionPrunableFullLegacy struct {
	Signatures            []ecc.Signature `json:"signatures"`
	PackedContextFreeData eos.HexBytes    `json:"packed_context_free_data"`
}

type PackedTransactionPrunableNone

type PackedTransactionPrunableNone struct {
	Digest eos.Checksum256 `json:"digest"`
}

type PackedTransactionPrunablePartial

type PackedTransactionPrunablePartial struct {
	Signatures          []ecc.Signature `json:"signatures"`
	ContextFreeSegments []*Segment      `json:"context_free_segments"`
}

type ProposerPolicy added in v1.5.0

type ProposerPolicy struct {
	ActiveTime       eos.BlockTimestamp             `json:"active_time"`
	ProducerSchedule *eos.ProducerAuthoritySchedule `json:"proposer_schedule"`
}

type PrunableData

type PrunableData struct {
	eos.BaseVariant
}

func (*PrunableData) UnmarshalBinary

func (r *PrunableData) UnmarshalBinary(decoder *eos.Decoder) error

type Segment

type Segment struct {
	eos.BaseVariant
}

func (*Segment) UnmarshalBinary

func (r *Segment) UnmarshalBinary(decoder *eos.Decoder) error

type SignedBlock

type SignedBlock struct {
	eos.SignedBlockHeader
	Transactions    []*TransactionReceipt `json:"transactions"`
	BlockExtensions []*eos.Extension      `json:"block_extensions"`
}

type Transaction

type Transaction struct {
	eos.BaseVariant
}

func (*Transaction) UnmarshalBinary

func (r *Transaction) UnmarshalBinary(decoder *eos.Decoder) error

type TransactionReceipt

type TransactionReceipt struct {
	eos.TransactionReceiptHeader
	Transaction eos.TransactionWithID `json:"trx"`
}

type TransactionTrace

type TransactionTrace struct {
	ID              eos.Checksum256               `json:"id"`
	BlockNum        uint32                        `json:"block_num"`
	BlockTime       eos.BlockTimestamp            `json:"block_time"`
	ProducerBlockID eos.Checksum256               `json:"producer_block_id" eos:"optional"`
	Receipt         *eos.TransactionReceiptHeader `json:"receipt,omitempty" eos:"optional"`
	Elapsed         eos.Int64                     `json:"elapsed"`
	NetUsage        eos.Uint64                    `json:"net_usage"`
	Scheduled       bool                          `json:"scheduled"`
	ActionTraces    []*ActionTrace                `json:"action_traces"`
	AccountRamDelta *AccountDelta                 `json:"account_ram_delta" eos:"optional"`
	FailedDtrxTrace *TransactionTrace             `json:"failed_dtrx_trace,omitempty" eos:"optional"`
	Except          *eos.Except                   `json:"except,omitempty" eos:"optional"`
	ErrorCode       *eos.Uint64                   `json:"error_code,omitempty" eos:"optional"`
}

TransactionTrace

File hierarchy:

Jump to

Keyboard shortcuts

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