pub enum GivenEnergy {
Absolute(Energy),
Add {
energy: Energy,
num_sigs: u32,
},
}
Expand description
An upper bound on the amount of energy to spend on a transaction. Transaction costs have two components, one is based on the size of the transaction and the number of signatures, and then there is a transaction specific one. This construction helps handle the fixed costs and allows the user to focus only on the transaction specific ones. The most important case for this are smart contract initialisations and updates.
Variants§
Absolute(Energy)
Use this exact amount of energy.
Add
Add the given amount of energy to the base amount. The base amount covers transaction size and signature checking.
Auto Trait Implementations§
impl RefUnwindSafe for GivenEnergy
impl Send for GivenEnergy
impl Sync for GivenEnergy
impl Unpin for GivenEnergy
impl UnwindSafe for GivenEnergy
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
Mutably borrows from an owned value. Read more