fc

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSystemIdentifierMissing      = errors.New("system identifier is missing")
	ErrMoneySystemIdentifierMissing = errors.New("money transaction system identifier is missing")
	ErrStateIsNil                   = errors.New("state is nil")
	ErrTrustBaseMissing             = errors.New("trust base is missing")
)

Functions

This section is empty.

Types

type AddFCValidationContext

type AddFCValidationContext struct {
	Tx                 *types.TransactionOrder
	Unit               *state.Unit
	CurrentRoundNumber uint64
}

type CloseFCValidationContext

type CloseFCValidationContext struct {
	Tx   *types.TransactionOrder
	Unit *state.Unit
}

type DefaultFeeCreditTxValidator

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

DefaultFeeCreditTxValidator default validator for partition specific "add fee credit" and "close fee credit" transactions

func NewDefaultFeeCreditTxValidator

func NewDefaultFeeCreditTxValidator(moneySystemID, systemID []byte, hashAlgorithm crypto.Hash, verifiers map[string]abcrypto.Verifier, feeCreditRecordUnitType []byte) *DefaultFeeCreditTxValidator

func (*DefaultFeeCreditTxValidator) ValidateAddFeeCredit

func (v *DefaultFeeCreditTxValidator) ValidateAddFeeCredit(ctx *AddFCValidationContext) error

func (*DefaultFeeCreditTxValidator) ValidateCloseFC

type FeeCalculator

type FeeCalculator func() uint64

func FixedFee

func FixedFee(fee uint64) FeeCalculator

type FeeCredit

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

FeeCredit contains fee credit related functionality.

func NewFeeCreditModule

func NewFeeCreditModule(opts ...Option) (*FeeCredit, error)

func (*FeeCredit) GenericTransactionValidator

func (f *FeeCredit) GenericTransactionValidator() txsystem.GenericTransactionValidator

func (*FeeCredit) TxExecutors

func (f *FeeCredit) TxExecutors() map[string]txsystem.TxExecutor

type Option

type Option func(f *FeeCredit)

func WithFeeCalculator

func WithFeeCalculator(feeCalculator FeeCalculator) Option

func WithFeeCreditRecordUnitType

func WithFeeCreditRecordUnitType(feeCreditRecordUnitType []byte) Option

func WithHashAlgorithm

func WithHashAlgorithm(hashAlgorithm crypto.Hash) Option

func WithLogger

func WithLogger(logger logger.Logger) Option

func WithMoneySystemIdentifier

func WithMoneySystemIdentifier(moneySystemID []byte) Option

func WithState

func WithState(s *state.State) Option

func WithSystemIdentifier

func WithSystemIdentifier(systemID []byte) Option

func WithTrustBase

func WithTrustBase(trustBase map[string]abcrypto.Verifier) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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