utxodbledger

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: Apache-2.0, BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UtxoDBLedger

type UtxoDBLedger struct {
	*utxodb.UtxoDB
	// contains filtered or unexported fields
}

UtxoDBLedger implements txstream.Ledger by wrapping UTXODB

func New

func New(log *logger.Logger) *UtxoDBLedger

New creates a new empty ledger

func (*UtxoDBLedger) Detach

func (u *UtxoDBLedger) Detach()

Detach detaches the event handlers

func (*UtxoDBLedger) EventTransactionBooked

func (u *UtxoDBLedger) EventTransactionBooked() *events.Event

EventTransactionBooked returns an event that triggers when a transaction is booked

func (*UtxoDBLedger) EventTransactionConfirmed

func (u *UtxoDBLedger) EventTransactionConfirmed() *events.Event

EventTransactionConfirmed returns an event that triggers when a transaction is confirmed

func (*UtxoDBLedger) GetConfirmedTransaction

func (u *UtxoDBLedger) GetConfirmedTransaction(txid ledgerstate.TransactionID, f func(*ledgerstate.Transaction)) bool

GetConfirmedTransaction fetches a transaction by ID, and executes the given callback if found

func (*UtxoDBLedger) GetTxInclusionState

func (u *UtxoDBLedger) GetTxInclusionState(txid ledgerstate.TransactionID) (ledgerstate.InclusionState, error)

GetTxInclusionState returns the inclusion state of the given transaction

func (*UtxoDBLedger) GetUnspentOutputs

func (u *UtxoDBLedger) GetUnspentOutputs(addr ledgerstate.Address, f func(output ledgerstate.Output))

GetUnspentOutputs returns the available UTXOs for an address

func (*UtxoDBLedger) PostTransaction

func (u *UtxoDBLedger) PostTransaction(tx *ledgerstate.Transaction) error

PostTransaction posts a transaction to the ledger

func (*UtxoDBLedger) RequestFunds

func (u *UtxoDBLedger) RequestFunds(target ledgerstate.Address) error

RequestFunds requests funds from the faucet

Jump to

Keyboard shortcuts

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