settlement

package
v0.0.0-...-79ba347 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuditEvent

func NewAuditEvent(epoch uint64) event.Event

NewAuditEvent creates new AuditEvent for epoch.

func NewBasicIncomeCollectEvent

func NewBasicIncomeCollectEvent(epoch uint64) event.Event

NewBasicIncomeCollectEvent for epoch.

func NewBasicIncomeDistributeEvent

func NewBasicIncomeDistributeEvent(epoch uint64) event.Event

NewBasicIncomeDistributeEvent for epoch.

Types

type AlphabetState

type AlphabetState interface {
	IsAlphabet() bool
}

AlphabetState is a callback interface for inner ring global state.

type AuditEvent

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

AuditEvent is an event of the start of cash settlements for data audit.

func (AuditEvent) Epoch

func (e AuditEvent) Epoch() uint64

Epoch returns the number of the epoch in which the event was generated.

func (AuditEvent) MorphEvent

func (e AuditEvent) MorphEvent()

MorphEvent implements Neo:Morph event.

type AuditProcessor

type AuditProcessor interface {
	// Must process data audit conducted in epoch.
	ProcessAuditSettlements(epoch uint64)
}

AuditProcessor is an interface of data audit fee processor.

type BasicIncomeCollectEvent

type BasicIncomeCollectEvent = AuditEvent

type BasicIncomeDistributeEvent

type BasicIncomeDistributeEvent = AuditEvent

type BasicIncomeInitializer

type BasicIncomeInitializer interface {
	// Creates context that processes basic income for provided epoch.
	CreateContext(epoch uint64) (*basic.IncomeSettlementContext, error)
}

BasicIncomeInitializer is an interface of basic income context creator.

type Option

type Option func(*options)

Option is a Processor constructor's option.

func WithLogger

func WithLogger(l *logger.Logger) Option

WithLogger returns option to override the component for logging.

type Prm

type Prm struct {
	AuditProcessor AuditProcessor
	BasicIncome    BasicIncomeInitializer
	State          AlphabetState
}

Prm groups the required parameters of Processor's constructor.

type Processor

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

Processor is an event handler for payments in the system.

func New

func New(prm Prm, opts ...Option) *Processor

New creates and returns a new Processor instance.

func (*Processor) HandleAuditEvent

func (p *Processor) HandleAuditEvent(e event.Event)

HandleAuditEvent catches a new AuditEvent and adds AuditProcessor call to the execution queue.

func (*Processor) HandleIncomeCollectionEvent

func (p *Processor) HandleIncomeCollectionEvent(e event.Event)

func (*Processor) HandleIncomeDistributionEvent

func (p *Processor) HandleIncomeDistributionEvent(e event.Event)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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