audit

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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CalculatePrm

type CalculatePrm struct {
	// Number of epoch to perform the calculation.
	Epoch uint64
}

CalculatePrm groups the required parameters of Calculator.CalculateForEpoch call.

type Calculator

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

Calculator represents a component for calculating payments based on data audit results and sending remittances to the chain.

func NewCalculator

func NewCalculator(p *CalculatorPrm, opts ...CalculatorOption) *Calculator

NewCalculator creates, initializes and returns a new Calculator instance.

func (*Calculator) Calculate

func (c *Calculator) Calculate(p *CalculatePrm)

Calculate calculates payments for audit results in a specific epoch of the network. Wraps the results in a money transfer transaction and sends it to the network.

type CalculatorOption

type CalculatorOption func(*options)

CalculatorOption is a Calculator constructor's option.

func WithLogger

func WithLogger(l *logger.Logger) CalculatorOption

WithLogger returns an option to specify the logging component.

type CalculatorPrm

type CalculatorPrm struct {
	ResultStorage ResultStorage

	ContainerStorage common.ContainerStorage

	PlacementCalculator common.PlacementCalculator

	SGStorage SGStorage

	AccountStorage common.AccountStorage

	Exchanger common.Exchanger

	AuditFeeFetcher FeeFetcher
}

CalculatorPrm groups the parameters of Calculator's constructor.

type FeeFetcher

type FeeFetcher interface {
	AuditFee() (uint64, error)
}

FeeFetcher wraps AuditFee method that returns audit fee price from the network configuration.

type ResultStorage

type ResultStorage interface {
	// Must return all audit results by epoch number.
	AuditResultsForEpoch(epoch uint64) ([]*audit.Result, error)
}

ResultStorage is an interface of storage of the audit results.

type SGInfo

type SGInfo interface {
	// Must return sum size of the all group members.
	Size() uint64
}

SGInfo groups the data about FrostFS storage group necessary for calculating audit fee.

type SGStorage

type SGStorage interface {
	// Must return information about the storage group by address.
	SGInfo(oid.Address) (SGInfo, error)
}

SGStorage is an interface of storage of the storage groups.

Jump to

Keyboard shortcuts

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