ledger

package
v0.0.0-...-5f1ae1a Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2018 License: ISC Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountState

type AccountState struct {
	AccountRoot data.AccountRoot
	RippleState []data.RippleState
}

type CanonicalTxSet

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

func (*CanonicalTxSet) Add

func (s *CanonicalTxSet) Add(tx data.Transaction)

func (CanonicalTxSet) Len

func (s CanonicalTxSet) Len() int

func (CanonicalTxSet) Less

func (s CanonicalTxSet) Less(i, j int) bool

func (CanonicalTxSet) Sort

func (s CanonicalTxSet) Sort(lastClosedLedger data.Hash256)

func (CanonicalTxSet) Swap

func (s CanonicalTxSet) Swap(i, j int)

type CurrencyPair

type CurrencyPair struct {
	Left  data.Currency
	Right data.Currency
}

type LedgerState

type LedgerState struct {
	*data.Ledger
	AccountState *RadixMap
	Transactions *RadixMap
	Books        map[CurrencyPair]Offers
	// contains filtered or unexported fields
}

func NewEmptyLedgerState

func NewEmptyLedgerState(sequence uint32) *LedgerState

func NewLedgerStateFromDB

func NewLedgerStateFromDB(hash data.Hash256, db storage.DB) (*LedgerState, error)

func (*LedgerState) Fill

func (state *LedgerState) Fill() error

func (*LedgerState) Sequence

func (state *LedgerState) Sequence() uint32

func (*LedgerState) Summary

func (state *LedgerState) Summary() (string, error)

type Manager

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

func NewManager

func NewManager(db storage.DB) (*Manager, error)

func (*Manager) Copy

func (m *Manager) Copy() *RadixMap

func (*Manager) Current

func (m *Manager) Current(current uint32)

func (*Manager) Missing

func (m *Manager) Missing(*data.LedgerRange) *data.Work

func (*Manager) Start

func (m *Manager) Start()

func (*Manager) String

func (m *Manager) String() string

func (*Manager) Submit

func (m *Manager) Submit(items []data.Hashable)

type Offers

type Offers struct {
	Asks []data.Offer
	Bids []data.Offer
}

type OpsByAction

type OpsByAction struct{ RadixOperations }

func (OpsByAction) Less

func (ops OpsByAction) Less(i, j int) bool

type OpsByIndex

type OpsByIndex struct{ RadixOperations }

func (OpsByIndex) Less

func (ops OpsByIndex) Less(i, j int) bool

type Queue

type Queue []*LedgerState

func (*Queue) Add

func (q *Queue) Add(s *LedgerState)

func (*Queue) AddEmpty

func (q *Queue) AddEmpty()

func (*Queue) Do

func (q *Queue) Do(f QueueFunc) error

func (Queue) Len

func (q Queue) Len() int

func (Queue) Less

func (q Queue) Less(i, j int) bool

func (*Queue) Pop

func (q *Queue) Pop() bool

func (Queue) Swap

func (q Queue) Swap(i, j int)

type QueueFunc

type QueueFunc func(*LedgerState, *LedgerState) error

type RadixAction

type RadixAction byte
const (
	Addition RadixAction = 'A'
	Deletion RadixAction = 'D'
	Movement RadixAction = 'M'
)

type RadixMap

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

func NewEmptyRadixMap

func NewEmptyRadixMap() *RadixMap

func NewRadixMap

func NewRadixMap(root data.Hash256, db storage.DB) *RadixMap

func (*RadixMap) Fill

func (m *RadixMap) Fill() error

func (*RadixMap) Ledger

func (m *RadixMap) Ledger() *data.Ledger

func (*RadixMap) Summary

func (m *RadixMap) Summary(summary map[string]uint64) error

func (*RadixMap) Walk

func (m *RadixMap) Walk(f WalkFunc) error

type RadixNode

type RadixNode struct {
	Node  data.Storer
	Depth uint8
}

type RadixOperation

type RadixOperation struct {
	*RadixNode
	Action RadixAction
}

TODO Replace this with NodeId(Depth!)

func NewRadixOperation

func NewRadixOperation(action RadixAction, node data.Storer, depth uint8) *RadixOperation

func (RadixOperation) String

func (r RadixOperation) String() string

type RadixOperations

type RadixOperations []*RadixOperation

func Diff

func Diff(left, right data.Hash256, db storage.DB) (RadixOperations, error)

func (*RadixOperations) Add

func (ro *RadixOperations) Add(node data.Storer, action RadixAction, depth uint8)

func (RadixOperations) Fold

func (ro RadixOperations) Fold() RadixOperations

Converts nodes that are both added and deleted into moved

func (RadixOperations) Len

func (ro RadixOperations) Len() int

func (RadixOperations) String

func (ro RadixOperations) String() []string

func (RadixOperations) Swap

func (ro RadixOperations) Swap(i, j int)

type Sync

type Sync interface {
	Current(uint32)
	Missing(*data.LedgerRange) *data.Work
	Submit([]data.Hashable)
	Copy() *RadixMap
}

type WalkFunc

type WalkFunc func(key data.Hash256, node *RadixNode) error

Jump to

Keyboard shortcuts

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