conflicts

package
v1.1.0-codec-update Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 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 Conflicts

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

func New

func New() *Conflicts

func (*Conflicts) Accept

func (c *Conflicts) Accept(txID ids.ID)

Accept notifies this conflict manager that a tx has been conditionally accepted. This means that assuming all the txs this tx depends on are accepted, then this tx should be accepted as well. This

func (*Conflicts) Add

func (c *Conflicts) Add(txIntf choices.Decidable) error

Add this tx to the conflict set. If this tx is of the correct type, this tx will be added to the set of processing txs. It is assumed this tx wasn't already processing. This will mark the consumed utxos and register a rejector that will be notified if a dependency of this tx was rejected.

func (*Conflicts) Conflicts

func (c *Conflicts) Conflicts(txIntf choices.Decidable) ([]choices.Decidable, error)

Conflicts returns the collection of txs that are currently processing that conflict with the provided tx. It is allowed to call with function with txs that aren't yet processing or currently processing txs.

func (*Conflicts) IsVirtuous

func (c *Conflicts) IsVirtuous(txIntf choices.Decidable) (bool, error)

IsVirtuous checks the currently processing txs for conflicts. It is allowed to call with function with txs that aren't yet processing or currently processing txs.

func (*Conflicts) Updateable

func (c *Conflicts) Updateable() ([]choices.Decidable, []choices.Decidable)

type TestTx

type TestTx struct {
	choices.TestDecidable

	DependenciesV []Tx
	InputIDsV     []ids.ID
	VerifyV       error
	BytesV        []byte
}

TestTx is a useful test tx

func (*TestTx) Bytes

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

Bytes implements the Tx interface

func (*TestTx) Dependencies

func (t *TestTx) Dependencies() []Tx

Dependencies implements the Tx interface

func (*TestTx) InputIDs

func (t *TestTx) InputIDs() []ids.ID

InputIDs implements the Tx interface

func (*TestTx) Verify

func (t *TestTx) Verify() error

Verify implements the Tx interface

type Tx

type Tx interface {
	choices.Decidable

	// Dependencies is a list of transactions upon which this transaction
	// depends. Each element of Dependencies must be verified before Verify is
	// called on this transaction.
	//
	// Similarly, each element of Dependencies must be accepted before this
	// transaction is accepted.
	Dependencies() []Tx

	// InputIDs is a set where each element is the ID of a piece of state that
	// will be consumed if this transaction is accepted.
	//
	// In the context of a UTXO-based payments system, for example, this would
	// be the IDs of the UTXOs consumed by this transaction
	InputIDs() []ids.ID

	Verify() error
	Bytes() []byte
}

Tx consumes state.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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