mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 14:01:02 +00:00
seal: Refactor ext_gas_price (#6478)
* seal: Refactor ext_gas_price * Remove seals dependency on pallet_transaction_payment * Add weight as an argument to ext_gas_price * Fixed documentation nits from review * Do not use unchecked math even in test code
This commit is contained in:
committed by
GitHub
parent
f36b78570f
commit
a3a42f599a
@@ -696,12 +696,14 @@ define_env!(Env, <E: Ext>,
|
||||
Ok(())
|
||||
},
|
||||
|
||||
// Stores the gas price for the current transaction into the scratch buffer.
|
||||
// Stores the price for the specified amount of gas in scratch buffer.
|
||||
//
|
||||
// The data is encoded as T::Balance. The current contents of the scratch buffer are overwritten.
|
||||
ext_gas_price(ctx) => {
|
||||
// It is recommended to avoid specifying very small values for `gas` as the prices for a single
|
||||
// gas can be smaller than one.
|
||||
ext_gas_price(ctx, gas: u64) => {
|
||||
ctx.scratch_buf.clear();
|
||||
ctx.ext.get_weight_price().encode_to(&mut ctx.scratch_buf);
|
||||
ctx.ext.get_weight_price(gas).encode_to(&mut ctx.scratch_buf);
|
||||
Ok(())
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user