retainer

package
v1.0.0-alpha.15 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewBlockRetainerEvents = event.CreateGroupConstructor(func() (newEvents *BlockRetainerEvents) {
	return &BlockRetainerEvents{
		BlockRetained:  event.New1[*blocks.Block](),
		BlockAccepted:  event.New1[*blocks.Block](),
		BlockConfirmed: event.New1[*blocks.Block](),
	}
})

NewBlockRetainerEvents contains the constructor of the Events object (it is generated by a generic factory).

View Source
var NewTransactionRetainerEvents = event.CreateGroupConstructor(func() (newEvents *TransactionRetainerEvents) {
	return &TransactionRetainerEvents{
		TransactionRetained: event.New1[iotago.TransactionID](),
	}
})

NewTransactionRetainerEvents contains the constructor of the Events object (it is generated by a generic factory).

Functions

This section is empty.

Types

type BlockRetainer

type BlockRetainer interface {
	BlockMetadata(blockID iotago.BlockID) (*api.BlockMetadataResponse, error)

	// Reset resets the component to a clean state as if it was created at the last commitment.
	Reset()

	// Interface embeds the required methods of the module.Module.
	module.Module
}

BlockRetainer keeps and resolves all the block related information needed in the API and INX.

type BlockRetainerEvents

type BlockRetainerEvents struct {
	// BlockRetained is triggered when a block is stored in the retainer.
	BlockRetained *event.Event1[*blocks.Block]
	// BlockAccepted is triggered when a block is stored in the retainer caused by a block acceptance event.
	BlockAccepted *event.Event1[*blocks.Block]
	// BlockConfirmed is triggered when a block is stored in the retainer caused by a block confirmed event.
	BlockConfirmed *event.Event1[*blocks.Block]

	event.Group[BlockRetainerEvents, *BlockRetainerEvents]
}

BlockRetainerEvents is a collection of Retainer related BlockRetainerEvents.

type TransactionRetainer

type TransactionRetainer interface {
	// TransactionMetadata returns the metadata of a transaction.
	TransactionMetadata(txID iotago.TransactionID) (*api.TransactionMetadataResponse, error)

	// Reset resets the component to a clean state as if it was created at the last commitment.
	Reset(targetSlot iotago.SlotIndex)

	module.Module
}

TransactionRetainer keeps and resolves all the transaction-related metadata needed in the API and INX.

type TransactionRetainerEvents

type TransactionRetainerEvents struct {
	// TransactionRetained is triggered when a transaction is stored in the retainer.
	TransactionRetained *event.Event1[iotago.TransactionID]

	event.Group[TransactionRetainerEvents, *TransactionRetainerEvents]
}

TransactionRetainerEvents is a collection of Retainer related TransactionRetainerEvents.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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