mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-17 13:35:41 +00:00
Dispatch Calls to other modules (#1473)
* WIP * Use system::Origin::Signed as an origin * Add a vm test for ext_dispatch_call * Take fee for dispatching a Call # Conflicts: # node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm * Clean & Rebuild # Conflicts: # node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm * Dispatch call test. * Rebuild the runtime. * Fix the length of the buffer. * Rebuild binaries.
This commit is contained in:
committed by
Gav Wood
parent
22b65c9cb0
commit
58cd6530be
@@ -247,6 +247,13 @@ pub fn refund_unused_gas<T: Trait>(transactor: &T::AccountId, gas_meter: GasMete
|
||||
<balances::Module<T>>::increase_total_stake_by(refund);
|
||||
}
|
||||
|
||||
/// A little handy utility for converting a value in balance units into approximitate value in gas units
|
||||
/// at the given gas price.
|
||||
pub fn approx_gas_for_balance<T: Trait>(gas_price: T::Balance, balance: T::Balance) -> T::Gas {
|
||||
let amount_in_gas: T::Balance = balance / gas_price;
|
||||
<T::Gas as As<T::Balance>>::sa(amount_in_gas)
|
||||
}
|
||||
|
||||
/// A simple utility macro that helps to match against a
|
||||
/// list of tokens.
|
||||
#[macro_export]
|
||||
|
||||
Reference in New Issue
Block a user