commit

package
v0.0.0-...-b544036 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package commit provides an implementation for finding transaction commit status that is specific to the Gateway embedded within a peer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finder

type Finder struct {
	// contains filtered or unexported fields
}

Finder is used to obtain transaction status.

func NewFinder

func NewFinder(query QueryProvider, notifier *Notifier) *Finder

func (*Finder) TransactionStatus

func (finder *Finder) TransactionStatus(ctx context.Context, channelName string, transactionID string) (*Status, error)

TransactionStatus provides status of a specified transaction on a given channel. If the transaction has already committed, the status is returned immediately; otherwise this call blocks waiting for the transaction to be committed or the context to be cancelled.

type NotificationSupplier

type NotificationSupplier interface {
	CommitNotifications(done <-chan struct{}, channelName string) (<-chan *ledger.CommitNotification, error)
}

NotificationSupplier obtains a commit notification channel for a specific ledger. It provides an abstraction of the use of Peer, Channel and Ledger to obtain this result, and allows mocking in unit tests.

type Notifier

type Notifier struct {
	// contains filtered or unexported fields
}

Notifier provides notification of transaction commits.

func NewNotifier

func NewNotifier(supplier NotificationSupplier) *Notifier

type QueryProvider

type QueryProvider interface {
	TransactionStatus(channelName string, transactionID string) (peer.TxValidationCode, uint64, error)
}

QueryProvider provides status of previously committed transactions on a given channel. An error is returned if the transaction is not present in the ledger.

type Status

type Status struct {
	BlockNumber   uint64
	TransactionID string
	Code          peer.TxValidationCode
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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