settlement

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: BSD-3-Clause Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPeerNoSettlements = errors.New("no settlements for peer")
)

Functions

This section is empty.

Types

type Interface

type Interface interface {
	// Pay initiates a payment to the given peer
	// It should return without error it is likely that the payment worked
	Pay(ctx context.Context, peer boson.Address, amount *big.Int) error
	// TotalSent returns the total amount sent to a peer
	TotalSent(peer boson.Address) (totalSent *big.Int, err error)
	// TotalReceived returns the total amount received from a peer
	TotalReceived(peer boson.Address) (totalSent *big.Int, err error)
	// SettlementsSent returns sent settlements for each individual known peer
	SettlementsSent() (map[string]*big.Int, error)
	// SettlementsReceived returns received settlements for each individual known peer
	SettlementsReceived() (map[string]*big.Int, error)
	// SetNotifyPaymentFunc sets the NotifyPaymentFunc to notify
	SetNotifyPaymentFunc(notifyPaymentFunc NotifyPaymentFunc)
}

Interface is the interface used by Accounting to trigger settlement

type NotifyPaymentFunc

type NotifyPaymentFunc func(peer boson.Address, amount *big.Int) error

NotifyPaymentFunc is called when a payment from peer was successfully received

Directories

Path Synopsis
Package pseudosettle implements a pretend settlement protocol where nodes send pretend payment messages consisting only of the payment amount.
Package pseudosettle implements a pretend settlement protocol where nodes send pretend payment messages consisting only of the payment amount.
pb

Jump to

Keyboard shortcuts

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