fc

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: Apache-2.0 Imports: 6 Imported by: 7

Documentation

Index

Constants

View Source
const (
	TransactionTypeTransferFeeCredit uint16 = 14
	TransactionTypeReclaimFeeCredit  uint16 = 15
	TransactionTypeAddFeeCredit      uint16 = 16
	TransactionTypeCloseFeeCredit    uint16 = 17
)

Variables

This section is empty.

Functions

func IsFeeCreditTx

func IsFeeCreditTx(tx *types.TransactionOrder) bool

func PrndSh

func PrndSh(ownerPredicate []byte, timeout uint64) func(buf []byte) error

PrndSh returns function which generates pseudo-random byte sequence based on the input. Meant to be used as unit identifier generator in PDR.ComposeUnitID. Subsequent calls return the same value.

Types

type AddFeeCreditAttributes

type AddFeeCreditAttributes struct {
	FeeCreditOwnerPredicate []byte               // target fee credit record owner predicate
	FeeCreditTransferProof  *types.TxRecordProof // transaction proof of "transfer fee credit" transaction
	// contains filtered or unexported fields
}

type AddFeeCreditAuthProof

type AddFeeCreditAuthProof struct {
	OwnerProof []byte
	// 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
	Counter           uint64 // the transaction counter of this fee credit record
	// contains filtered or unexported fields
}

type CloseFeeCreditAuthProof

type CloseFeeCreditAuthProof struct {
	OwnerProof []byte
	// contains filtered or unexported fields
}

type FeeCreditRecord

type FeeCreditRecord struct {
	Version        types.Version `json:"version"`
	Balance        uint64        `json:"balance,string"`     // current balance
	OwnerPredicate hex.Bytes     `json:"ownerPredicate"`     // the owner predicate of this fee credit record
	Counter        uint64        `json:"counter,string"`     // transaction counter; incremented with each “addFC” or "closeFC" transaction; spending fee credit does not change this value
	MinLifetime    uint64        `json:"minLifetime,string"` // the earliest round number when this record may be deleted if the balance goes to zero
	// 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 NewFeeCreditRecord

func NewFeeCreditRecord(balance uint64, ownerPredicate []byte, minLifetime uint64) *FeeCreditRecord

func (*FeeCreditRecord) Copy

func (b *FeeCreditRecord) Copy() types.UnitData

func (*FeeCreditRecord) GetCounter

func (b *FeeCreditRecord) GetCounter() uint64

func (*FeeCreditRecord) GetVersion

func (b *FeeCreditRecord) GetVersion() types.Version

func (*FeeCreditRecord) IsExpired

func (b *FeeCreditRecord) IsExpired(currentRoundNumber uint64) bool

func (*FeeCreditRecord) MarshalCBOR

func (b *FeeCreditRecord) MarshalCBOR() ([]byte, error)

func (*FeeCreditRecord) Owner

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

func (*FeeCreditRecord) SummaryValueInput

func (b *FeeCreditRecord) SummaryValueInput() uint64

func (*FeeCreditRecord) UnmarshalCBOR

func (b *FeeCreditRecord) UnmarshalCBOR(data []byte) error

func (*FeeCreditRecord) Write

func (b *FeeCreditRecord) Write(hasher abhash.Hasher)

type LockFeeCreditAttributes

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

type LockFeeCreditAuthProof

type LockFeeCreditAuthProof struct {
	OwnerProof []byte
	// contains filtered or unexported fields
}

type ReclaimFeeCreditAttributes

type ReclaimFeeCreditAttributes struct {
	CloseFeeCreditProof *types.TxRecordProof // transaction proof of "close fee credit" transaction
	// contains filtered or unexported fields
}

type ReclaimFeeCreditAuthProof

type ReclaimFeeCreditAuthProof struct {
	OwnerProof []byte
	// contains filtered or unexported fields
}

type TransferFeeCreditAttributes

type TransferFeeCreditAttributes struct {
	Amount             uint64            // amount to transfer
	TargetPartitionID  types.PartitionID // partition identifier of the target partition
	TargetRecordID     []byte            // unit id of the corresponding “add fee credit” transaction
	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 TransferFeeCreditAuthProof

type TransferFeeCreditAuthProof struct {
	OwnerProof []byte
	// contains filtered or unexported fields
}

type UnlockFeeCreditAttributes

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

type UnlockFeeCreditAuthProof

type UnlockFeeCreditAuthProof struct {
	OwnerProof []byte
	// 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