Documentation ¶
Index ¶
- Constants
- func NewProvider(opts ...options.Option[UTXOLedger]) module.Provider[*engine.Engine, ledger.Ledger]
- func WithMemPoolProvider(provider module.Provider[*engine.Engine, mempool.MemPool]) options.Option[UTXOLedger]
- type StateDiffs
- func (s *StateDiffs) Delete(index slot.Index) (err error)
- func (s *StateDiffs) DeleteCreatedOutput(index slot.Index, outputID utxo.OutputID) (err error)
- func (s *StateDiffs) DeleteCreatedOutputs(index slot.Index, outputIDs utxo.OutputIDs) (err error)
- func (s *StateDiffs) DeleteSpentOutput(index slot.Index, outputID utxo.OutputID) (err error)
- func (s *StateDiffs) DeleteSpentOutputs(index slot.Index, outputIDs utxo.OutputIDs) (err error)
- func (s *StateDiffs) Export(writer io.WriteSeeker, targetSlot slot.Index) (err error)
- func (s *StateDiffs) Import(reader io.ReadSeeker) (importedSlots []slot.Index, err error)
- func (s *StateDiffs) LoadCreatedOutput(index slot.Index, outputID utxo.OutputID) (outputWithMetadata *mempool.OutputWithMetadata, err error)
- func (s *StateDiffs) LoadSpentOutput(index slot.Index, outputID utxo.OutputID) (outputWithMetadata *mempool.OutputWithMetadata, err error)
- func (s *StateDiffs) StoreCreatedOutput(outputWithMetadata *mempool.OutputWithMetadata) (err error)
- func (s *StateDiffs) StoreSpentOutput(outputWithMetadata *mempool.OutputWithMetadata) (err error)
- func (s *StateDiffs) StreamCreatedOutputs(index slot.Index, callback func(*mempool.OutputWithMetadata) error) (err error)
- func (s *StateDiffs) StreamSpentOutputs(index slot.Index, callback func(*mempool.OutputWithMetadata) error) (err error)
- type UTXOLedger
- func (l *UTXOLedger) ApplyStateDiff(index slot.Index) (err error)
- func (l *UTXOLedger) Events() *ledger.Events
- func (l *UTXOLedger) Export(writer io.WriteSeeker, targetSlot slot.Index) (err error)
- func (l *UTXOLedger) Import(reader io.ReadSeeker) (err error)
- func (l *UTXOLedger) MemPool() mempool.MemPool
- func (l *UTXOLedger) StateDiffs() ledger.StateDiffs
- func (l *UTXOLedger) UnspentOutputs() ledger.UnspentOutputs
- type UnspentOutputs
- func (u *UnspentOutputs) ApplyCreatedOutput(output *mempool.OutputWithMetadata) (err error)
- func (u *UnspentOutputs) ApplySpentOutput(output *mempool.OutputWithMetadata) (err error)
- func (u *UnspentOutputs) Begin(newSlot slot.Index) (lastCommittedSlot slot.Index, err error)
- func (u *UnspentOutputs) Commit() (ctx context.Context)
- func (u *UnspentOutputs) Consumers() (consumers []ledger.UnspentOutputsSubscriber)
- func (u *UnspentOutputs) Export(writer io.WriteSeeker) (err error)
- func (u *UnspentOutputs) IDs() *ads.Set[utxo.OutputID, *utxo.OutputID]
- func (u *UnspentOutputs) Import(reader io.ReadSeeker, targetSlot slot.Index) (err error)
- func (u *UnspentOutputs) RollbackCreatedOutput(output *mempool.OutputWithMetadata) (err error)
- func (u *UnspentOutputs) RollbackSpentOutput(output *mempool.OutputWithMetadata) (err error)
- func (u *UnspentOutputs) Subscribe(consumer ledger.UnspentOutputsSubscriber)
- func (u *UnspentOutputs) Unsubscribe(consumer ledger.UnspentOutputsSubscriber)
Constants ¶
View Source
const ( PrefixUnspentOutputsLatestCommittedIndex byte = iota PrefixUnspentOutputsIDs )
Variables ¶
This section is empty.
Functions ¶
func NewProvider ¶
Types ¶
type StateDiffs ¶
type StateDiffs struct {
// contains filtered or unexported fields
}
func NewStateDiffs ¶
func NewStateDiffs(e *engine.Engine) *StateDiffs
func (*StateDiffs) DeleteCreatedOutput ¶
func (*StateDiffs) DeleteCreatedOutputs ¶
func (*StateDiffs) DeleteSpentOutput ¶
func (*StateDiffs) DeleteSpentOutputs ¶
func (*StateDiffs) Export ¶
func (s *StateDiffs) Export(writer io.WriteSeeker, targetSlot slot.Index) (err error)
func (*StateDiffs) Import ¶
func (s *StateDiffs) Import(reader io.ReadSeeker) (importedSlots []slot.Index, err error)
func (*StateDiffs) LoadCreatedOutput ¶
func (s *StateDiffs) LoadCreatedOutput(index slot.Index, outputID utxo.OutputID) (outputWithMetadata *mempool.OutputWithMetadata, err error)
func (*StateDiffs) LoadSpentOutput ¶
func (s *StateDiffs) LoadSpentOutput(index slot.Index, outputID utxo.OutputID) (outputWithMetadata *mempool.OutputWithMetadata, err error)
func (*StateDiffs) StoreCreatedOutput ¶
func (s *StateDiffs) StoreCreatedOutput(outputWithMetadata *mempool.OutputWithMetadata) (err error)
func (*StateDiffs) StoreSpentOutput ¶
func (s *StateDiffs) StoreSpentOutput(outputWithMetadata *mempool.OutputWithMetadata) (err error)
func (*StateDiffs) StreamCreatedOutputs ¶
func (s *StateDiffs) StreamCreatedOutputs(index slot.Index, callback func(*mempool.OutputWithMetadata) error) (err error)
func (*StateDiffs) StreamSpentOutputs ¶
func (s *StateDiffs) StreamSpentOutputs(index slot.Index, callback func(*mempool.OutputWithMetadata) error) (err error)
type UTXOLedger ¶
UTXOLedger represents a ledger using the realities based mempool.
func (*UTXOLedger) ApplyStateDiff ¶
func (l *UTXOLedger) ApplyStateDiff(index slot.Index) (err error)
ApplyStateDiff applies the state diff of the given slot to the ledger state.
func (*UTXOLedger) Events ¶
func (l *UTXOLedger) Events() *ledger.Events
func (*UTXOLedger) Export ¶
func (l *UTXOLedger) Export(writer io.WriteSeeker, targetSlot slot.Index) (err error)
Export exports the ledger state to the given writer.
func (*UTXOLedger) Import ¶
func (l *UTXOLedger) Import(reader io.ReadSeeker) (err error)
Import imports the ledger state from the given reader.
func (*UTXOLedger) MemPool ¶
func (l *UTXOLedger) MemPool() mempool.MemPool
func (*UTXOLedger) StateDiffs ¶
func (l *UTXOLedger) StateDiffs() ledger.StateDiffs
func (*UTXOLedger) UnspentOutputs ¶
func (l *UTXOLedger) UnspentOutputs() ledger.UnspentOutputs
type UnspentOutputs ¶
type UnspentOutputs struct { traits.BatchCommittable module.Module // contains filtered or unexported fields }
func NewUnspentOutputs ¶
func NewUnspentOutputs(e *engine.Engine) (unspentOutputs *UnspentOutputs)
func (*UnspentOutputs) ApplyCreatedOutput ¶
func (u *UnspentOutputs) ApplyCreatedOutput(output *mempool.OutputWithMetadata) (err error)
func (*UnspentOutputs) ApplySpentOutput ¶
func (u *UnspentOutputs) ApplySpentOutput(output *mempool.OutputWithMetadata) (err error)
func (*UnspentOutputs) Commit ¶
func (u *UnspentOutputs) Commit() (ctx context.Context)
func (*UnspentOutputs) Consumers ¶
func (u *UnspentOutputs) Consumers() (consumers []ledger.UnspentOutputsSubscriber)
func (*UnspentOutputs) Export ¶
func (u *UnspentOutputs) Export(writer io.WriteSeeker) (err error)
func (*UnspentOutputs) Import ¶
func (u *UnspentOutputs) Import(reader io.ReadSeeker, targetSlot slot.Index) (err error)
func (*UnspentOutputs) RollbackCreatedOutput ¶
func (u *UnspentOutputs) RollbackCreatedOutput(output *mempool.OutputWithMetadata) (err error)
func (*UnspentOutputs) RollbackSpentOutput ¶
func (u *UnspentOutputs) RollbackSpentOutput(output *mempool.OutputWithMetadata) (err error)
func (*UnspentOutputs) Subscribe ¶
func (u *UnspentOutputs) Subscribe(consumer ledger.UnspentOutputsSubscriber)
func (*UnspentOutputs) Unsubscribe ¶
func (u *UnspentOutputs) Unsubscribe(consumer ledger.UnspentOutputsSubscriber)
Click to show internal directories.
Click to hide internal directories.