auditor

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Pending is the status of a transaction that has been submitted to the ledger
	Pending = ttxdb.Pending
	// Confirmed is the status of a transaction that has been confirmed by the ledger
	Confirmed = ttxdb.Confirmed
	// Deleted is the status of a transaction that has been deleted due to a failure to commit
	Deleted = ttxdb.Deleted
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Auditor

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

Auditor is the interface for the auditor service

func Get

Get returns the Auditor instance for the passed auditor wallet

func New

New returns the Auditor instance for the passed auditor wallet

func (*Auditor) Append

func (a *Auditor) Append(tx Transaction) error

Append adds the passed transaction to the auditor database. It also releases the locks acquired by Audit.

func (*Auditor) Audit

Audit extracts the list of inputs and outputs from the passed transaction. In addition, the Audit locks the enrollment named ids. Release must be invoked in case

func (*Auditor) GetStatus added in v0.3.0

func (a *Auditor) GetStatus(txID string) (TxStatus, error)

GetStatus return the status of the given transaction id. It returns an error if no transaction with that id is found

func (*Auditor) GetTokenRequest added in v0.3.0

func (a *Auditor) GetTokenRequest(txID string) ([]byte, error)

GetTokenRequest returns the token request bound to the passed transaction id, if available.

func (*Auditor) NewQueryExecutor

func (a *Auditor) NewQueryExecutor() *QueryExecutor

NewQueryExecutor returns a new query executor

func (*Auditor) Release added in v0.2.0

func (a *Auditor) Release(tx Transaction)

Release releases the lock acquired of the passed transaction.

func (*Auditor) SetStatus

func (a *Auditor) SetStatus(txID string, status TxStatus) error

SetStatus sets the status of the audit records with the passed transaction id to the passed status

func (*Auditor) Validate

func (a *Auditor) Validate(request *token.Request) error

Validate validates the passed token request

type Entry

type Entry struct {
	TMSID    token.TMSID
	WalletID string
}

type KVS

type KVS interface {
	Exists(id string) bool
	Put(id string, state interface{}) error
	Get(id string, state interface{}) error
}

type Manager

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

Manager handles the databases

func NewManager

func NewManager(sp view.ServiceProvider, kvs KVS) *Manager

NewManager creates a new Auditor manager.

func (*Manager) Auditor

func (cm *Manager) Auditor(w *token.AuditorWallet) (*Auditor, error)

Auditor returns the Auditor for the given wallet

func (*Manager) Restore

func (cm *Manager) Restore() error

type QueryExecutor

type QueryExecutor struct {
	*ttxdb.QueryExecutor
}

QueryExecutor defines the interface for the query executor

func (*QueryExecutor) Done

func (a *QueryExecutor) Done()

Done closes the query executor. It must be called when the query executor is no longer needed.

func (*QueryExecutor) NewHoldingsFilter

func (a *QueryExecutor) NewHoldingsFilter() *ttxdb.HoldingsFilter

NewHoldingsFilter returns a filter for holdings

func (*QueryExecutor) NewPaymentsFilter

func (a *QueryExecutor) NewPaymentsFilter() *ttxdb.PaymentsFilter

NewPaymentsFilter returns a filter for payments

type Transaction

type Transaction interface {
	ID() string
	Network() string
	Channel() string
	Request() *token.Request
}

Transaction models a generic token transaction

type TxStatus

type TxStatus = ttxdb.TxStatus

TxStatus is the status of a transaction

type TxStatusChangesListener

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

func (*TxStatusChangesListener) OnStatusChange

func (t *TxStatusChangesListener) OnStatusChange(txID string, status int) error

Jump to

Keyboard shortcuts

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