common

package
v0.0.0-...-0ba0ddf Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuditSettlementDetails

func AuditSettlementDetails(epoch uint64) []byte

func BasicIncomeCollectionDetails

func BasicIncomeCollectionDetails(epoch uint64) []byte

func BasicIncomeDistributionDetails

func BasicIncomeDistributionDetails(epoch uint64) []byte

func TransferAssets

func TransferAssets(e Exchanger, t *TransferTable, details []byte)

Types

type AccountStorage

type AccountStorage interface {
	// Must resolve information about the storage node
	// to its ID in system.
	ResolveKey(NodeInfo) (*user.ID, error)
}

AccountStorage is an network member accounts interface.

type ContainerInfo

type ContainerInfo interface {
	// Must return identifier of the container owner.
	Owner() user.ID
}

ContainerInfo groups the data about NeoFS container necessary for calculating audit fee.

type ContainerStorage

type ContainerStorage interface {
	// Must return information about the container by ID.
	ContainerInfo(cid.ID) (ContainerInfo, error)
}

ContainerStorage is an interface of storage of the NeoFS containers.

type Exchanger

type Exchanger interface {
	// Must transfer amount of GASe-12 from sender to recipient.
	//
	// Amount must be positive.
	Transfer(sender, recipient user.ID, amount *big.Int, details []byte)
}

Exchanger is an interface of monetary component.

type NodeInfo

type NodeInfo interface {
	// Must return storage price of the node for one epoch in GASe-12.
	Price() *big.Int

	// Must return public key of the node.
	PublicKey() []byte
}

NodeInfo groups the data about the storage node necessary for calculating audit fees.

type PlacementCalculator

type PlacementCalculator interface {
	// Must return information about the nodes from container by its ID of the given epoch.
	ContainerNodes(uint64, cid.ID) ([]NodeInfo, error)
}

PlacementCalculator is a component interface that builds placement vectors.

type TransferTable

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

func NewTransferTable

func NewTransferTable() *TransferTable

func (*TransferTable) Iterate

func (t *TransferTable) Iterate(f func(*TransferTx))

func (*TransferTable) Transfer

func (t *TransferTable) Transfer(tx *TransferTx)

type TransferTx

type TransferTx struct {
	From, To user.ID

	Amount *big.Int
}

Jump to

Keyboard shortcuts

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