money

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: AGPL-3.0 Imports: 16 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// The ID of the dust collector money supply
	// TODO: can't be hardcoded, depends on the PDR (AB-1819)
	DustCollectorMoneySupplyID = append(make(types.UnitID, 32), money.BillUnitType)

	// Dust collector predicate
	DustCollectorPredicate = templates.NewP2pkh256BytesFromKey([]byte("dust collector"))
)
View Source
var (
	ErrBillLocked             = errors.New("bill is locked")
	ErrTargetPartitionIDEmpty = errors.New("TargetPartitionID is empty")
	ErrTargetRecordIDEmpty    = errors.New("TargetRecordID is empty")
	ErrRecordIDExists         = errors.New("fee transaction cannot contain fee credit reference")
	ErrFeeProofExists         = errors.New("fee transaction cannot contain fee authorization proof")
	ErrInvalidFCValue         = errors.New("the amount to transfer cannot exceed the value of the bill")
	ErrInvalidFeeValue        = errors.New("the transaction max fee cannot exceed the transferred amount")
	ErrInvalidCounter         = errors.New("the transaction counter is not equal to the unit counter")
)
View Source
var (
	ErrReclaimFCInvalidTargetUnit        = errors.New("invalid target unit")
	ErrReclaimFCInvalidTxFee             = errors.New("the transaction fees cannot exceed the transferred value")
	ErrReclaimFCInvalidTargetUnitCounter = errors.New("invalid target unit counter")
)

Functions

Types

type DustCollector

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

func NewDustCollector

func NewDustCollector(s *state.State) *DustCollector

func (*DustCollector) AddDustBill

func (d *DustCollector) AddDustBill(id types.UnitID, currentBlockNumber uint64)

func (*DustCollector) GetDustBills

func (d *DustCollector) GetDustBills(blockNumber uint64) []types.UnitID

func (*DustCollector) RemoveDustBills

func (d *DustCollector) RemoveDustBills(blockNumber uint64)

type Module

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

func NewMoneyModule

func NewMoneyModule(pdr types.PartitionDescriptionRecord, options *Options) (*Module, error)

func (*Module) BeginBlockFuncs

func (m *Module) BeginBlockFuncs() []func(blockNr uint64) error

func (*Module) EndBlockFuncs

func (m *Module) EndBlockFuncs() []func(blockNumber uint64) error

func (*Module) TxHandlers added in v1.0.0

func (m *Module) TxHandlers() map[uint16]txtypes.TxExecutor

type Option

type Option func(*Options)

func WithExecutedTransactions added in v1.0.0

func WithExecutedTransactions(executedTransactions map[string]uint64) Option

func WithHashAlgorithm

func WithHashAlgorithm(hashAlgorithm crypto.Hash) Option

func WithPredicateExecutor added in v0.4.0

func WithPredicateExecutor(exec predicates.PredicateExecutor) Option

WithPredicateExecutor allows to replace the default predicate executor function. Should be used by tests only.

func WithState

func WithState(s *state.State) Option

func WithTrustBase

func WithTrustBase(trust types.RootTrustBase) Option

type Options

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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