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) FeeCreditRecordUnitType() uint32
- func (f *FeeCreditModule) IsCredible(exeCtx txtypes.ExecutionContext, tx *types.TransactionOrder) error
- func (f *FeeCreditModule) IsFeeCreditTx(tx *types.TransactionOrder) bool
- func (f *FeeCreditModule) IsFeelessMode() bool
- func (f *FeeCreditModule) IsPermissionedMode() bool
- func (f *FeeCreditModule) IsValid() error
- func (f *FeeCreditModule) NewFeeCreditRecordID(ownerPredicate []byte, timeout uint64) (types.UnitID, error)
- 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) FeeCreditRecordUnitType() uint32
- func (f *NoFeeHandling) IsCredible(_ txtypes.ExecutionContext, _ *types.TransactionOrder) error
- func (f *NoFeeHandling) IsFeeCreditTx(tx *types.TransactionOrder) bool
- func (f *NoFeeHandling) IsFeelessMode() bool
- func (f *NoFeeHandling) IsPermissionedMode() bool
- func (f *NoFeeHandling) TxHandlers() map[uint16]txtypes.TxExecutor
- type Observability
- type Option
- type StateReader
Constants ¶
View Source
const ( GeneralTxCostGasUnits = 400 GasUnitsPerTema = 1000 )
Variables ¶
View Source
var ( ErrMoneyPartitionIDMissing = errors.New("money transaction partition 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 ¶ added in v1.0.0
func ValidateCloseFC(attr *fc.CloseFeeCreditAttributes, fcr *fc.FeeCreditRecord) error
func ValidateGenericFeeCreditTx ¶ added in v1.0.0
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 ¶ added in v1.0.0
func VerifyMaxTxFeeDoesNotExceedFRCBalance(tx *types.TransactionOrder, fcrBalance uint64) error
Types ¶
type FeeBalanceValidator ¶ added in v1.0.0
type FeeBalanceValidator struct {
// contains filtered or unexported fields
}
func NewFeeBalanceValidator ¶ added in v1.0.0
func NewFeeBalanceValidator(pdr types.PartitionDescriptionRecord, stateReader StateReader, execPredicate predicates.PredicateRunner, feeCreditRecordUnitType uint32) *FeeBalanceValidator
func (*FeeBalanceValidator) IsCredible ¶ added in v1.0.0
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 ¶ added in v1.0.0
type FeeCreditModule struct {
// contains filtered or unexported fields
}
FeeCreditModule contains fee credit related functionality.
func NewFeeCreditModule ¶
func NewFeeCreditModule(pdr types.PartitionDescriptionRecord, moneyPartitionID types.PartitionID, state *state.State, trustBase types.RootTrustBase, obs Observability, opts ...Option) (*FeeCreditModule, error)
func (*FeeCreditModule) BuyGas ¶ added in v1.0.0
func (f *FeeCreditModule) BuyGas(maxTxCost uint64) uint64
func (*FeeCreditModule) CalculateCost ¶ added in v1.0.0
func (f *FeeCreditModule) CalculateCost(gasUsed uint64) uint64
func (*FeeCreditModule) FeeCreditRecordUnitType ¶ added in v1.0.0
func (f *FeeCreditModule) FeeCreditRecordUnitType() uint32
func (*FeeCreditModule) IsCredible ¶ added in v1.0.0
func (f *FeeCreditModule) IsCredible(exeCtx txtypes.ExecutionContext, tx *types.TransactionOrder) error
func (*FeeCreditModule) IsFeeCreditTx ¶ added in v1.0.0
func (f *FeeCreditModule) IsFeeCreditTx(tx *types.TransactionOrder) bool
func (*FeeCreditModule) IsFeelessMode ¶ added in v1.0.0
func (f *FeeCreditModule) IsFeelessMode() bool
func (*FeeCreditModule) IsPermissionedMode ¶ added in v1.0.0
func (f *FeeCreditModule) IsPermissionedMode() bool
func (*FeeCreditModule) IsValid ¶ added in v1.0.0
func (f *FeeCreditModule) IsValid() error
func (*FeeCreditModule) NewFeeCreditRecordID ¶ added in v1.0.0
func (*FeeCreditModule) TxHandlers ¶ added in v1.0.0
func (f *FeeCreditModule) TxHandlers() map[uint16]txtypes.TxExecutor
type NoFeeHandling ¶ added in v1.0.0
type NoFeeHandling struct{}
func NewNoFeeCreditModule ¶ added in v1.0.0
func NewNoFeeCreditModule() *NoFeeHandling
func (*NoFeeHandling) BuyGas ¶ added in v1.0.0
func (f *NoFeeHandling) BuyGas(_ uint64) uint64
func (*NoFeeHandling) CalculateCost ¶ added in v1.0.0
func (f *NoFeeHandling) CalculateCost(_ uint64) uint64
func (*NoFeeHandling) FeeCreditRecordUnitType ¶ added in v1.0.0
func (f *NoFeeHandling) FeeCreditRecordUnitType() uint32
func (*NoFeeHandling) IsCredible ¶ added in v1.0.0
func (f *NoFeeHandling) IsCredible(_ txtypes.ExecutionContext, _ *types.TransactionOrder) error
func (*NoFeeHandling) IsFeeCreditTx ¶ added in v1.0.0
func (f *NoFeeHandling) IsFeeCreditTx(tx *types.TransactionOrder) bool
func (*NoFeeHandling) IsFeelessMode ¶ added in v1.0.0
func (f *NoFeeHandling) IsFeelessMode() bool
func (*NoFeeHandling) IsPermissionedMode ¶ added in v1.0.0
func (f *NoFeeHandling) IsPermissionedMode() bool
func (*NoFeeHandling) TxHandlers ¶ added in v1.0.0
func (f *NoFeeHandling) TxHandlers() map[uint16]txtypes.TxExecutor
type Observability ¶ added in v1.0.0
type Option ¶
type Option func(f *FeeCreditModule)
func WithHashAlgorithm ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.