Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update test expectations
  • Loading branch information
KiChjang committed Sep 29, 2022
commit aaf27f6b48f761113dd01c8718ec301e7383ef04
10 changes: 5 additions & 5 deletions frame/system/src/extensions/check_weight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ mod tests {
check(|max, len| {
assert_ok!(CheckWeight::<Test>::do_pre_dispatch(max, len));
assert_eq!(System::block_weight().total(), Weight::MAX);
assert!(System::block_weight().total().all_gt(block_weight_limit()));
assert!(System::block_weight().total().ref_time() > block_weight_limit().ref_time());
});
check(|max, len| {
assert_ok!(CheckWeight::<Test>::do_validate(max, len));
Expand Down Expand Up @@ -367,7 +367,7 @@ mod tests {
new_test_ext().execute_with(|| {
System::register_extra_weight_unchecked(Weight::MAX, DispatchClass::Normal);
assert_eq!(System::block_weight().total(), Weight::MAX);
assert!(System::block_weight().total().all_gt(block_weight_limit()));
assert!(System::block_weight().total().ref_time() > block_weight_limit().ref_time());
});
}

Expand All @@ -392,8 +392,8 @@ mod tests {
assert_ok!(CheckWeight::<Test>::do_pre_dispatch(&max_normal, len));
assert_eq!(System::block_weight().total(), Weight::from_ref_time(768));
assert_ok!(CheckWeight::<Test>::do_pre_dispatch(&rest_operational, len));
assert_eq!(block_weight_limit(), Weight::from_ref_time(1024));
assert_eq!(System::block_weight().total(), block_weight_limit());
assert_eq!(block_weight_limit(), Weight::from_ref_time(1024).set_proof_size(u64::MAX));
assert_eq!(System::block_weight().total(), block_weight_limit().set_proof_size(0));
// Checking single extrinsic should not take current block weight into account.
assert_eq!(CheckWeight::<Test>::check_extrinsic_weight(&rest_operational), Ok(()));
});
Expand Down Expand Up @@ -669,7 +669,7 @@ mod tests {
assert_ok!(CheckWeight::<Test>::do_pre_dispatch(&max_normal, len));
assert_eq!(System::block_weight().total(), Weight::from_ref_time(768));
assert_ok!(CheckWeight::<Test>::do_pre_dispatch(&mandatory, len));
assert_eq!(block_weight_limit(), Weight::from_ref_time(1024));
assert_eq!(block_weight_limit(), Weight::from_ref_time(1024).set_proof_size(u64::MAX));
assert_eq!(System::block_weight().total(), Weight::from_ref_time(1024 + 768));
assert_eq!(CheckWeight::<Test>::check_extrinsic_weight(&mandatory), Ok(()));
});
Expand Down
2 changes: 1 addition & 1 deletion frame/transaction-payment/asset-tx-payment/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl Get<frame_system::limits::BlockWeights> for BlockWeights {
weights.base_extrinsic = ExtrinsicBaseWeight::get().into();
})
.for_class(DispatchClass::non_mandatory(), |weights| {
weights.max_total = Weight::from_ref_time(1024).into();
weights.max_total = Weight::from_ref_time(1024).set_proof_size(u64::MAX).into();
})
.build_or_panic()
}
Expand Down