unit

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: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCredit

func AddCredit(id types.UnitID, owner types.PredicateBytes, data *FeeCreditRecord) state.Action

AddCredit adds a new credit record

func DecrCredit

func DecrCredit(id types.UnitID, value uint64) state.Action

DecrCredit decrements the balance of given FeeCreditRecord

func DelCredit

func DelCredit(id types.UnitID) state.Action

DelCredit deletes the credit record

func IncrCredit

func IncrCredit(id types.UnitID, value uint64, timeout uint64, transactionRecordHash []byte) state.Action

IncrCredit increments the balance of given FeeCreditRecord

Types

type FeeCreditRecord

type FeeCreditRecord struct {
	Balance  uint64 // current balance
	Backlink []byte // hash of the last “addFC”, "closeFC", "lockFC" or "unlockFC" transaction
	Timeout  uint64 // the earliest round number when this record may be “garbage collected” if the balance goes to zero
	Locked   uint64 // locked status of the fee credit record, non-zero value means locked
	// contains filtered or unexported fields
}

FeeCreditRecord state tree unit data of fee credit records. Holds fee credit balance for individual users, not to be confused with fee credit bills which contain aggregate fees for a given partition.

func (*FeeCreditRecord) Copy

func (b *FeeCreditRecord) Copy() state.UnitData
func (b *FeeCreditRecord) GetBacklink() []byte

func (*FeeCreditRecord) IsLocked

func (b *FeeCreditRecord) IsLocked() bool

func (*FeeCreditRecord) SummaryValueInput

func (b *FeeCreditRecord) SummaryValueInput() uint64

func (*FeeCreditRecord) Write

func (b *FeeCreditRecord) Write(hasher hash.Hash) error

Jump to

Keyboard shortcuts

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