Versions in this module Expand all Collapse all v0 v0.1.1 Oct 1, 2023 v0.1.0 Sep 29, 2023 Changes in this version + const PrefixUnspentOutputsIDs + const PrefixUnspentOutputsLatestCommittedIndex + 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 struct + func NewStateDiffs(e *engine.Engine) *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 struct + 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 struct + func NewUnspentOutputs(e *engine.Engine) (unspentOutputs *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)