Skip to content

Commit

Permalink
Store dispatch info of calls locally in weight calculation (#7849)
Browse files Browse the repository at this point in the history
* utility

* sudo

* more

* recovery

* better formatting
  • Loading branch information
shawntabrizi authored Jan 8, 2021
1 parent 8b10bed commit 25d2394
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,16 @@ decl_module! {
/// - DB Weight: None
/// - Plus Call Weight
/// # </weight>
#[weight = (
T::WeightInfo::as_multi_threshold_1(call.using_encoded(|c| c.len() as u32))
.saturating_add(call.get_dispatch_info().weight)
// 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();
(
T::WeightInfo::as_multi_threshold_1(call.using_encoded(|c| c.len() as u32))
.saturating_add(dispatch_info.weight)
// AccountData for inner call origin accountdata.
.saturating_add(T::DbWeight::get().reads_writes(1, 1)),
dispatch_info.class,
)
}]
fn as_multi_threshold_1(origin,
other_signatories: Vec<T::AccountId>,
call: Box<<T as Config>::Call>,
Expand Down

0 comments on commit 25d2394

Please sign in to comment.