Documentation
¶
Index ¶
- Constants
- Variables
- func ValidateCloseFC(attr *fc.CloseFeeCreditAttributes, fcr *fc.FeeCreditRecord) error
- func ValidateGenericFeeCreditTx(tx *types.TransactionOrder) error
- func VerifyMaxTxFeeDoesNotExceedFRCBalance(tx *types.TransactionOrder, fcrBalance uint64) error
- type FeeBalanceValidator
- type FeeCreditModule
- func (f *FeeCreditModule) BuyGas(maxTxCost uint64) uint64
- func (f *FeeCreditModule) CalculateCost(gasUsed uint64) uint64
- func (f *FeeCreditModule) IsCredible(exeCtx txtypes.ExecutionContext, tx *types.TransactionOrder) error
- func (f *FeeCreditModule) IsFeeCreditTx(tx *types.TransactionOrder) bool
- func (f *FeeCreditModule) IsValid() error
- func (f *FeeCreditModule) NewFeeCreditRecordID(unitID []byte, ownerPredicate []byte, timeout uint64) types.UnitID
- func (f *FeeCreditModule) TxHandlers() map[uint16]txtypes.TxExecutor
- type NoFeeHandling
- func (f *NoFeeHandling) BuyGas(_ uint64) uint64
- func (f *NoFeeHandling) CalculateCost(_ uint64) uint64
- func (f *NoFeeHandling) IsCredible(_ txtypes.ExecutionContext, _ *types.TransactionOrder) error
- func (f *NoFeeHandling) IsFeeCreditTx(tx *types.TransactionOrder) bool
- func (f *NoFeeHandling) TxHandlers() map[uint16]txtypes.TxExecutor
- type Option
- type StateReader
Constants ¶
View Source
const ( GeneralTxCostGasUnits = 400 GasUnitsPerTema = 1000 )
Variables ¶
View Source
var ( ErrNetworkIdentifierMissing = errors.New("network identifier is missing") ErrSystemIdentifierMissing = errors.New("system identifier is missing") ErrMoneySystemIdentifierMissing = errors.New("money transaction system identifier is missing") ErrStateIsNil = errors.New("state is nil") ErrTrustBaseIsNil = errors.New("trust base is nil") )
View Source
var ( ErrUnitTypeIsNotFCR = errors.New("invalid unit identifier: type is not fee credit record") ErrUnitDataTypeIsNotFCR = errors.New("invalid unit type: unit is not fee credit record") )
Functions ¶
func ValidateCloseFC ¶
func ValidateCloseFC(attr *fc.CloseFeeCreditAttributes, fcr *fc.FeeCreditRecord) error
func ValidateGenericFeeCreditTx ¶
func ValidateGenericFeeCreditTx(tx *types.TransactionOrder) error
ValidateGenericFeeCreditTx none of the fee credit transactions must contain fee credit reference or separate fee authorization proof
func VerifyMaxTxFeeDoesNotExceedFRCBalance ¶
func VerifyMaxTxFeeDoesNotExceedFRCBalance(tx *types.TransactionOrder, fcrBalance uint64) error
Types ¶
type FeeBalanceValidator ¶
type FeeBalanceValidator struct {
// contains filtered or unexported fields
}
func NewFeeBalanceValidator ¶
func NewFeeBalanceValidator(stateReader StateReader, execPredicate predicates.PredicateRunner, feeCreditRecordUnitType []byte) *FeeBalanceValidator
func (*FeeBalanceValidator) IsCredible ¶
func (f *FeeBalanceValidator) IsCredible(exeCtx txtypes.ExecutionContext, tx *types.TransactionOrder) error
IsCredible implements the fee credit verification for ordinary transactions (everything else except fee credit txs)
type FeeCreditModule ¶
type FeeCreditModule struct {
// contains filtered or unexported fields
}
FeeCreditModule contains fee credit related functionality.
func NewFeeCreditModule ¶
func (*FeeCreditModule) BuyGas ¶
func (f *FeeCreditModule) BuyGas(maxTxCost uint64) uint64
func (*FeeCreditModule) CalculateCost ¶
func (f *FeeCreditModule) CalculateCost(gasUsed uint64) uint64
func (*FeeCreditModule) IsCredible ¶
func (f *FeeCreditModule) IsCredible(exeCtx txtypes.ExecutionContext, tx *types.TransactionOrder) error
func (*FeeCreditModule) IsFeeCreditTx ¶
func (f *FeeCreditModule) IsFeeCreditTx(tx *types.TransactionOrder) bool
func (*FeeCreditModule) IsValid ¶
func (f *FeeCreditModule) IsValid() error
func (*FeeCreditModule) NewFeeCreditRecordID ¶
func (*FeeCreditModule) TxHandlers ¶
func (f *FeeCreditModule) TxHandlers() map[uint16]txtypes.TxExecutor
type NoFeeHandling ¶
type NoFeeHandling struct{}
func NewNoFeeCreditModule ¶
func NewNoFeeCreditModule() *NoFeeHandling
func (*NoFeeHandling) BuyGas ¶
func (f *NoFeeHandling) BuyGas(_ uint64) uint64
func (*NoFeeHandling) CalculateCost ¶
func (f *NoFeeHandling) CalculateCost(_ uint64) uint64
func (*NoFeeHandling) IsCredible ¶
func (f *NoFeeHandling) IsCredible(_ txtypes.ExecutionContext, _ *types.TransactionOrder) error
func (*NoFeeHandling) IsFeeCreditTx ¶
func (f *NoFeeHandling) IsFeeCreditTx(tx *types.TransactionOrder) bool
func (*NoFeeHandling) TxHandlers ¶
func (f *NoFeeHandling) TxHandlers() map[uint16]txtypes.TxExecutor
type Option ¶
type Option func(f *FeeCreditModule)
func WithHashAlgorithm ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.