unit

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCredit

func AddCredit(id types.UnitID, owner state.Predicate, 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
	Hash    []byte // hash of the last “add fee credit” transaction that incremented the balance of this record
	Timeout uint64 // the earliest round number when this record may be “garbage collected” if the balance goes to zero
}

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 (*FeeCreditRecord) GetHash

func (b *FeeCreditRecord) GetHash() []byte

func (*FeeCreditRecord) SummaryValueInput

func (b *FeeCreditRecord) SummaryValueInput() uint64

func (*FeeCreditRecord) Write

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

Jump to

Keyboard shortcuts

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