Skip to content

Commit bb5dfba

Browse files
authored
Fix weight for inner call with new origin (#7196)
* fix weight for inner call with new origin * fix
1 parent 5457fe6 commit bb5dfba

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,13 @@ decl_module! {
352352
/// - The weight of the `call` + 10,000.
353353
/// - One storage lookup to check account is recovered by `who`. O(1)
354354
/// # </weight>
355-
#[weight = (call.get_dispatch_info().weight + 10_000, call.get_dispatch_info().class)]
355+
#[weight = (
356+
call.get_dispatch_info().weight
357+
.saturating_add(10_000)
358+
// AccountData for inner call origin accountdata.
359+
.saturating_add(T::DbWeight::get().reads_writes(1, 1)),
360+
call.get_dispatch_info().class
361+
)]
356362
fn as_recovered(origin,
357363
account: T::AccountId,
358364
call: Box<<T as Trait>::Call>

0 commit comments

Comments
 (0)