fc

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 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/close/lock/unlock fee credit transactions

func NewDefaultFeeCreditTxValidator

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

func (*DefaultFeeCreditTxValidator) ValidateAddFeeCredit

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

func (*DefaultFeeCreditTxValidator) ValidateCloseFC

func (*DefaultFeeCreditTxValidator) ValidateLockFC

func (*DefaultFeeCreditTxValidator) ValidateUnlockFC

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) CheckFeeCreditBalance

func (f *FeeCredit) CheckFeeCreditBalance(tx *types.TransactionOrder) error

CheckFeeCreditBalance implements the fee credit verification steps listed in the Yellowpaper "Valid Transaction Orders" chapter.

func (*FeeCredit) TxExecutors

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

type LockFCValidationContext

type LockFCValidationContext struct {
	Tx   *types.TransactionOrder
	Attr *transactions.LockFeeCreditAttributes
	Unit *state.Unit
}

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 WithMoneySystemIdentifier

func WithMoneySystemIdentifier(moneySystemID types.SystemID) Option

func WithState

func WithState(s *state.State) Option

func WithSystemIdentifier

func WithSystemIdentifier(systemID types.SystemID) Option

func WithTrustBase

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

type UnlockFCValidationContext

type UnlockFCValidationContext struct {
	Tx   *types.TransactionOrder
	Attr *transactions.UnlockFeeCreditAttributes
	Unit *state.Unit
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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