mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-19 19:15:41 +00:00
Store dispatch info of calls locally in weight calculation (#7849)
* utility * sudo * more * recovery * better formatting
This commit is contained in:
@@ -352,13 +352,16 @@ decl_module! {
|
||||
/// - The weight of the `call` + 10,000.
|
||||
/// - One storage lookup to check account is recovered by `who`. O(1)
|
||||
/// # </weight>
|
||||
#[weight = (
|
||||
call.get_dispatch_info().weight
|
||||
.saturating_add(10_000)
|
||||
// AccountData for inner call origin accountdata.
|
||||
.saturating_add(T::DbWeight::get().reads_writes(1, 1)),
|
||||
call.get_dispatch_info().class
|
||||
)]
|
||||
#[weight = {
|
||||
let dispatch_info = call.get_dispatch_info();
|
||||
(
|
||||
dispatch_info.weight
|
||||
.saturating_add(10_000)
|
||||
// AccountData for inner call origin accountdata.
|
||||
.saturating_add(T::DbWeight::get().reads_writes(1, 1)),
|
||||
dispatch_info.class,
|
||||
)
|
||||
}]
|
||||
fn as_recovered(origin,
|
||||
account: T::AccountId,
|
||||
call: Box<<T as Config>::Call>
|
||||
|
||||
Reference in New Issue
Block a user