committer

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrDiscardTX this error can be used to signal that a valid transaction should be discarded anyway
	ErrDiscardTX = errors.New("discard tx")
	// ErrUnknownTX this erro can be used to signal that a transaction is unknown
	ErrUnknownTX = errors.New("unknown tx")
)

Functions

func New

func New(
	networkName string,
	pm ProcessorManager,
	em driver.EnvelopeService,
	vault Vault,
	finality Finality,
	waitForEventTimeout time.Duration,
	quiet bool,
	eventsPublisher events.Publisher,
	eventsSubscriber events.Subscriber,
	tracerProvider trace.TracerProvider,
	networkConfig driver.NetworkConfig,
	listenerManager driver.ListenerManager,
) (*committer, error)

Types

type Finality

type Finality interface {
	IsFinal(txID string, address string) error
}

type FinalityManager added in v0.4.0

type ProcessorManager

type ProcessorManager interface {
	ProcessByID(txid string) error
}

type Vault

type Vault interface {
	Status(txID string) (driver.ValidationCode, string, error)
	SetStatus(txID string, code driver.ValidationCode) error
	Statuses(ids ...string) ([]driver.TxValidationStatus, error)
	DiscardTx(txID string, message string) error
	CommitTX(ctx context.Context, txid string, block driver.BlockNum, indexInBloc driver.TxNum) error
}

Jump to

Keyboard shortcuts

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