Struct oasis_runtime_sdk::modules::accounts::fee::FeeManager
source · pub struct FeeManager { /* private fields */ }
Expand description
The per-block fee manager that records what fees have been charged by the current transaction, how much should be refunded and what were all of the fee payments in the current block.
Note that the fee manager does not perform any state modifications by itself.
Implementations§
source§impl FeeManager
impl FeeManager
sourcepub fn tx_fee(&self) -> Option<&TransactionFee>
pub fn tx_fee(&self) -> Option<&TransactionFee>
Fees charged for the current transaction.
sourcepub fn record_fee(&mut self, payer: Address, amount: &BaseUnits)
pub fn record_fee(&mut self, payer: Address, amount: &BaseUnits)
Record that a transaction fee has been charged.
This method should only be called after the charged fee has been subtracted from the payer’s account (e.g. reflected in state).
sourcepub fn record_refund(&mut self, amount: u128)
pub fn record_refund(&mut self, amount: u128)
Record that a portion of the previously charged transaction fee should be refunded.
sourcepub fn commit_tx(&mut self) -> FeeUpdates
pub fn commit_tx(&mut self) -> FeeUpdates
Commit the currently open transaction fee by moving the final recorded amount into the fees charged for the current block.
Note that this does not perform any state modifications and the caller is assumed to apply any updates after calling this method.
sourcepub fn commit_block(self) -> BTreeMap<Denomination, u128>
pub fn commit_block(self) -> BTreeMap<Denomination, u128>
Commit the fees accumulated for the current block, returning the resulting map.
Note that this does not perform any state modifications and the caller is assumed to apply any updates after calling this method.
Trait Implementations§
source§impl Clone for FeeManager
impl Clone for FeeManager
source§fn clone(&self) -> FeeManager
fn clone(&self) -> FeeManager
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for FeeManager
impl Debug for FeeManager
source§impl Default for FeeManager
impl Default for FeeManager
source§fn default() -> FeeManager
fn default() -> FeeManager
Auto Trait Implementations§
impl Freeze for FeeManager
impl RefUnwindSafe for FeeManager
impl Send for FeeManager
impl Sync for FeeManager
impl Unpin for FeeManager
impl UnwindSafe for FeeManager
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)