Help us shape the future of Go! Take the 2026 Go Developer Survey

graph

package
v1.16.15 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestTx added in v1.1.11

type TestTx struct {
	choices.TestDecidable

	DependenciesV    set.Set[ids.ID]
	DependenciesErrV error
	VerifyV          error
	BytesV           []byte
}

TestTx is a useful test tx

func (*TestTx) Bytes added in v1.1.11

func (t *TestTx) Bytes() []byte

func (*TestTx) MissingDependencies added in v1.1.11

func (t *TestTx) MissingDependencies() (set.Set[ids.ID], error)

func (*TestTx) Verify added in v1.1.11

func (t *TestTx) Verify(context.Context) error

type TestVertex added in v1.1.11

type TestVertex struct {
	choices.TestDecidable

	ParentsV    []Vertex
	ParentsErrV error
	HeightV     uint64
	HeightErrV  error
	TxsV        []Tx
	TxsErrV     error
	BytesV      []byte
}

TestVertex is a useful test vertex

func (*TestVertex) Bytes added in v1.1.11

func (v *TestVertex) Bytes() []byte

func (*TestVertex) Height added in v1.1.11

func (v *TestVertex) Height() (uint64, error)

func (*TestVertex) Parents added in v1.1.11

func (v *TestVertex) Parents() ([]Vertex, error)

func (*TestVertex) Txs added in v1.1.11

func (v *TestVertex) Txs(context.Context) ([]Tx, error)

type Tx

type Tx interface {
	choices.Decidable

	// MissingDependencies returns the set of transactions that must be accepted
	// before this transaction is accepted.
	MissingDependencies() (set.Set[ids.ID], error)

	// Verify that the state transition this transaction would make if it were
	// accepted is valid. If the state transition is invalid, a non-nil error
	// should be returned.
	//
	// It is guaranteed that when Verify is called, all the dependencies of
	// this transaction have already been successfully verified.
	Verify(context.Context) error

	// Bytes returns the binary representation of this transaction.
	//
	// This is used for sending transactions to peers. Another node should be
	// able to parse these bytes to the same transaction.
	Bytes() []byte
}

Tx consumes state.

type Vertex added in v1.1.11

type Vertex interface {
	choices.Decidable

	// Parents returns the vertices this vertex depends on
	Parents() ([]Vertex, error)

	// Height returns the distance from this vertex to the genesis vertex
	Height() (uint64, error)

	// Txs returns the transactions this vertex contains
	Txs(context.Context) ([]Tx, error)

	// Bytes returns the byte representation of this vertex
	Bytes() []byte
}

Vertex is a node in the DAG.

Jump to

Keyboard shortcuts

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