fc

package
v0.0.0-...-e229939 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PayloadTypeAddFeeCredit      = "addFC"
	PayloadTypeCloseFeeCredit    = "closeFC"
	PayloadTypeReclaimFeeCredit  = "reclFC"
	PayloadTypeTransferFeeCredit = "transFC"
	PayloadTypeLockFeeCredit     = "lockFC"
	PayloadTypeUnlockFeeCredit   = "unlockFC"
)

Variables

This section is empty.

Functions

func IsFeeCreditTx

func IsFeeCreditTx(tx *types.TransactionOrder) bool

Types

type AddFeeCreditAttributes

type AddFeeCreditAttributes struct {
	FeeCreditOwnerCondition []byte                   // target fee credit record owner condition
	FeeCreditTransfer       *types.TransactionRecord // bill transfer record of type "transfer fee credit"
	FeeCreditTransferProof  *types.TxProof           // transaction proof of "transfer fee credit" transaction
	// contains filtered or unexported fields
}

type CloseFeeCreditAttributes

type CloseFeeCreditAttributes struct {
	Amount            uint64 // current balance of the fee credit record
	TargetUnitID      []byte // target unit id in money partition
	TargetUnitCounter uint64 // the current transaction counter of the target unit in money partition
	// contains filtered or unexported fields
}

type FeeCreditRecord

type FeeCreditRecord struct {
	Balance uint64 `json:"balance,string"` // current balance
	Counter uint64 `json:"counter,string"` // transaction counter; incremented with reach “addFC”, "closeFC", "lockFC" or "unlockFC" transaction; spending fee credit does not change this value
	Timeout uint64 `json:"timeout,string"` // the earliest round number when this record may be “garbage collected” if the balance goes to zero
	Locked  uint64 `json:"locked,string"`  // lock status of the fee credit record, non-zero value means locked; locked free credit does not prevent spending the fee credit
	// 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() types.UnitData

func (*FeeCreditRecord) GetCounter

func (b *FeeCreditRecord) GetCounter() uint64

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

type LockFeeCreditAttributes

type LockFeeCreditAttributes struct {
	LockStatus uint64 // status of the lock, non-zero value means locked
	Counter    uint64 // the transaction counter of the target unit
	// contains filtered or unexported fields
}

type ReclaimFeeCreditAttributes

type ReclaimFeeCreditAttributes struct {
	CloseFeeCreditTransfer *types.TransactionRecord // bill transfer record of type "close fee credit"
	CloseFeeCreditProof    *types.TxProof           // transaction proof of "close fee credit" transaction
	Counter                uint64                   // the transaction counter of this unit
	// contains filtered or unexported fields
}

type TransferFeeCreditAttributes

type TransferFeeCreditAttributes struct {
	Amount                 uint64         // amount to transfer
	TargetSystemIdentifier types.SystemID // system_identifier of the target partition
	TargetRecordID         []byte         // unit id of the corresponding “add fee credit” transaction
	EarliestAdditionTime   uint64         // earliest round when the corresponding “add fee credit” transaction can be executed in the target system
	LatestAdditionTime     uint64         // latest round when the corresponding “add fee credit” transaction can be executed in the target system
	TargetUnitCounter      *uint64        // the transaction counter of the target unit, or nil if the record does not exist yet
	Counter                uint64         // the transaction counter of this unit
	// contains filtered or unexported fields
}

type UnlockFeeCreditAttributes

type UnlockFeeCreditAttributes struct {
	Counter uint64 // the transaction counter of the target unit
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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