ledgerbackend

package
Version: v0.0.0-...-821bc58 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseBackend

type DatabaseBackend struct {
	DataSourceName string
	// contains filtered or unexported fields
}

DatabaseBackend implements a database data store.

func (*DatabaseBackend) Close

func (dbb *DatabaseBackend) Close() error

Close disconnects an active database session.

func (*DatabaseBackend) GetLatestLedgerSequence

func (dbb *DatabaseBackend) GetLatestLedgerSequence() (uint32, error)

GetLatestLedgerSequence returns the most recent ledger sequence number present in the database.

func (*DatabaseBackend) GetLedger

func (dbb *DatabaseBackend) GetLedger(sequence uint32) (bool, LedgerCloseMeta, error)

GetLedger returns the LedgerCloseMeta for the given ledger sequence number. The first returned value is false when the ledger does not exist in the database.

type LedgerBackend

type LedgerBackend interface {
	GetLatestLedgerSequence() (sequence uint32, err error)
	// The first returned value is false when the ledger does not exist in a backend.
	GetLedger(sequence uint32) (bool, LedgerCloseMeta, error)
	Close() error
}

LedgerBackend represents the interface to a ledger data store.

type LedgerCloseMeta

type LedgerCloseMeta struct {
	LedgerHeader          xdr.LedgerHeaderHistoryEntry
	TransactionEnvelope   []xdr.TransactionEnvelope
	TransactionResult     []xdr.TransactionResultPair
	TransactionMeta       []xdr.TransactionMeta
	TransactionFeeChanges []xdr.LedgerEntryChanges
}

LedgerCloseMeta is the information needed to reconstruct the history of transactions in a given ledger.

type MockDatabaseBackend

type MockDatabaseBackend struct {
	mock.Mock
}

func (*MockDatabaseBackend) Close

func (m *MockDatabaseBackend) Close() error

func (*MockDatabaseBackend) GetLatestLedgerSequence

func (m *MockDatabaseBackend) GetLatestLedgerSequence() (uint32, error)

func (*MockDatabaseBackend) GetLedger

func (m *MockDatabaseBackend) GetLedger(sequence uint32) (bool, LedgerCloseMeta, error)

Jump to

Keyboard shortcuts

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