retainer

package
v1.0.0-alpha.21 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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](),
		BlockDropped:   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]
	// BlockDropped is triggered when a block is dropped.
	BlockDropped *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