pub struct RuntimeFeesConfig {
pub action_fees: EnumMap<ActionCosts, Fee>,
pub storage_usage_config: StorageUsageConfig,
pub burnt_gas_reward: Rational32,
pub pessimistic_gas_price_inflation_ratio: Rational32,
pub refund_gas_price_changes: bool,
pub gas_refund_penalty: Rational32,
pub min_gas_refund_penalty: Gas,
}Fields§
§action_fees: EnumMap<ActionCosts, Fee>Gas fees for sending and executing actions.
storage_usage_config: StorageUsageConfigDescribes fees for storage.
burnt_gas_reward: Rational32Fraction of the burnt gas to reward to the contract account for execution.
pessimistic_gas_price_inflation_ratio: Rational32Pessimistic gas price inflation ratio.
refund_gas_price_changes: boolWhether we calculate in the gas price changes when refunding gas.
Changed to false with NEP-536
gas_refund_penalty: Rational32Relative cost for gas refunds as a ratio of the refunded amount.
The actual penalty is
max(gross_refund * gas_refund_penalty, min_gas_refund_penalty)
Added with NEP-536
min_gas_refund_penalty: GasMinimum cost for gas refunds.
The actual penalty is
max(gross_refund * gas_refund_penalty, min_gas_refund_penalty)
Added with NEP-536
Implementations§
Source§impl RuntimeFeesConfig
impl RuntimeFeesConfig
Sourcepub fn fee(&self, cost: ActionCosts) -> &Fee
pub fn fee(&self, cost: ActionCosts) -> &Fee
Access action fee by ActionCosts.
pub fn test() -> Self
pub fn free() -> Self
Sourcepub fn min_receipt_with_function_call_gas(&self) -> Gas
pub fn min_receipt_with_function_call_gas(&self) -> Gas
The minimum amount of gas required to create and execute a new receipt with a function call action. This amount is used to determine how many receipts can be created, send and executed for some amount of prepaid gas using function calls.
Sourcepub fn gas_penalty_for_gas_refund(&self, gas_refund: Gas) -> Gas
pub fn gas_penalty_for_gas_refund(&self, gas_refund: Gas) -> Gas
Given a left over gas amount to be refunded, returns how much should be subtracted as a penalty introduced with NEP-536.
Must return a value smaller or equal to the gas_refund parameter.
Trait Implementations§
Source§impl Clone for RuntimeFeesConfig
impl Clone for RuntimeFeesConfig
Source§fn clone(&self) -> RuntimeFeesConfig
fn clone(&self) -> RuntimeFeesConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RuntimeFeesConfig
impl Debug for RuntimeFeesConfig
Source§impl Hash for RuntimeFeesConfig
impl Hash for RuntimeFeesConfig
Source§impl PartialEq for RuntimeFeesConfig
impl PartialEq for RuntimeFeesConfig
impl Eq for RuntimeFeesConfig
impl StructuralPartialEq for RuntimeFeesConfig
Auto Trait Implementations§
impl Freeze for RuntimeFeesConfig
impl RefUnwindSafe for RuntimeFeesConfig
impl Send for RuntimeFeesConfig
impl Sync for RuntimeFeesConfig
impl Unpin for RuntimeFeesConfig
impl UnwindSafe for RuntimeFeesConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.