access

package
v0.47.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: AGPL-3.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LatestBoundary = map[uint64]Version{0: VersionLatest}

Functions

This section is empty.

Types

type AccountTransaction added in v0.47.0

type AccountTransaction struct {
	Address          flow.Address      // Account address
	BlockHeight      uint64            // Block height where transaction was included
	TransactionID    flow.Identifier   // Transaction identifier
	TransactionIndex uint32            // Index of transaction within the block
	Roles            []TransactionRole // Roles of the account in the transaction
}

AccountTransaction represents a transaction entry from the account transaction index. It contains the essential fields needed to identify and locate a transaction, plus metadata about the account's participation.

type CompatibleRange

type CompatibleRange struct {
	// StartHeight is the first block that the version supports.
	StartHeight uint64

	// EndHeight is the last block that the version supports.
	EndHeight uint64
}

CompatibleRange contains the first and the last height that the node's version supports.

type EventProvider added in v0.44.0

type EventProvider func() (flow.EventsList, error)

EventProvider is a callback function that returns a list of events required to construct the system collection.

func StaticEventProvider added in v0.44.0

func StaticEventProvider(events flow.EventsList) EventProvider

StaticEventProvider returns an event provider that returns the given events.

type HeightVersionMapper added in v0.44.0

type HeightVersionMapper interface {
	// GetVersion returns the version corresponding to the given height.
	GetVersion(height uint64) Version

	// All versions defined in the mapper.
	AllVersions() []Version
}

HeightVersionMapper defines the interface for mapping heights to protocol versions.

type NetworkParameters

type NetworkParameters struct {
	ChainID flow.ChainID
}

NetworkParameters contains the network-wide parameters for the Flow blockchain.

type NodeVersionInfo

type NodeVersionInfo struct {
	Semver  string
	Commit  string
	SporkId flow.Identifier
	// ProtocolVersion is the deprecated protocol version number.
	// Deprecated: Previously this referred to the major software version as of the most recent spork.
	// Replaced by protocol_state_version.
	ProtocolVersion uint64
	// ProtocolStateVersion is the Protocol State version as of the latest finalized block.
	// This tracks the schema version of the Protocol State and is used to coordinate breaking changes in the Protocol.
	// Version numbers are monotonically increasing.
	ProtocolStateVersion uint64
	SporkRootBlockHeight uint64
	NodeRootBlockHeight  uint64
	CompatibleRange      *CompatibleRange
}

NodeVersionInfo contains information about node, such as semver, commit, sporkID, protocolVersion, etc

type StaticHeightVersionMapper added in v0.44.0

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

StaticHeightVersionMapper is an implementation that allows hardcoding the height boundaries for each protocol version.

func NewStaticHeightVersionMapper added in v0.44.0

func NewStaticHeightVersionMapper(heightVersionBoundaries map[uint64]Version) *StaticHeightVersionMapper

func (*StaticHeightVersionMapper) AllVersions added in v0.44.0

func (s *StaticHeightVersionMapper) AllVersions() []Version

func (*StaticHeightVersionMapper) GetVersion added in v0.44.0

func (s *StaticHeightVersionMapper) GetVersion(height uint64) Version

type SystemCollectionBuilder added in v0.44.0

type SystemCollectionBuilder interface {
	// ProcessCallbacksTransaction constructs a transaction for processing callbacks, for the given callback.
	//
	// No error returns are expected during normal operation.
	ProcessCallbacksTransaction(chain flow.Chain) (*flow.TransactionBody, error)

	// ExecuteCallbacksTransactions constructs a list of transaction to execute callbacks, for the given chain.
	//
	// No error returns are expected during normal operation.
	ExecuteCallbacksTransactions(chain flow.Chain, processEvents flow.EventsList) ([]*flow.TransactionBody, error)

	// SystemChunkTransaction creates and returns the transaction corresponding to the
	// system chunk for the given chain.
	//
	// No error returns are expected during normal operation.
	SystemChunkTransaction(chain flow.Chain) (*flow.TransactionBody, error)

	// SystemCollection constructs a system collection for the given chain.
	// Uses the provided event provider to get events required to construct the system collection.
	// A nil event provider behaves the same as an event provider that returns an empty EventsList.
	//
	// No error returns are expected during normal operation.
	SystemCollection(chain flow.Chain, providerFn EventProvider) (*flow.Collection, error)
}

SystemCollectionBuilder defines the builders for the system collections and their transactions.

type TransactionResult

type TransactionResult struct {
	Status          flow.TransactionStatus
	StatusCode      uint
	Events          []flow.Event
	ErrorMessage    string
	BlockID         flow.Identifier
	TransactionID   flow.Identifier
	CollectionID    flow.Identifier
	BlockHeight     uint64
	ComputationUsed uint64
}

TransactionResult represents a flow.TransactionResult with additional fields required for the Access API

func (*TransactionResult) IsExecuted

func (r *TransactionResult) IsExecuted() bool

func (*TransactionResult) IsFinal

func (r *TransactionResult) IsFinal() bool

type TransactionRole added in v0.47.0

type TransactionRole int
const (
	// CAUTION: these values are stored in the database. Do not change the values.
	TransactionRoleAuthorizer  TransactionRole = 0 // Account is an authorizer for the transaction
	TransactionRolePayer       TransactionRole = 1 // Account is the payer for the transaction
	TransactionRoleProposer    TransactionRole = 2 // Account is the proposer for the transaction
	TransactionRoleInteraction TransactionRole = 3 // Account is referenced by an event in the transaction
)

type Version added in v0.44.0

type Version uint8
var (
	VersionLatest Version = math.MaxInt8
)

type Versioned added in v0.44.0

type Versioned[T any] struct {
	// contains filtered or unexported fields
}

Versioned is a generic container that associates different versions of type T with their corresponding protocol versions, as determined by the HeightVersionMapper. This allows retaining and retrieving historical implementations of a type, ensuring correct behavior when the protocol evolves and previous versions must remain accessible for older data.

func NewVersioned added in v0.44.0

func NewVersioned[T any](versionedTypes map[Version]T, versionMapper HeightVersionMapper) *Versioned[T]

func (*Versioned[T]) All added in v0.44.0

func (v *Versioned[T]) All() []T

AllVersions returns All versions defined in the mapper. Note: the values are stored within a map, so the order of the returned slice is not deterministic.

func (*Versioned[T]) ByHeight added in v0.44.0

func (v *Versioned[T]) ByHeight(height uint64) T

ByHeight version of the type at the provided height.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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