Properly set the max proof size weight on defaults and tests (#12383)

* Properly set the max proof size weight on defaults and tests

* cargo fmt

* Set proper max proof size for contracts pallet tests

* Properly set max proof size for node

* Properly set max proof size for frame system mock

* Update test expectations

* Update test expectations

* Properly set max proof size for balances mock

* Update test expectations

* Update test expectations

* Properly set max proof size for democracy mock

* Properly set max proof size for scheduler mock

* Properly set max proof size for fast unstake mock

* Properly set max proof size for tx payment mock

* Properly set max proof size for elections phragmen mock

* Properly set max proof size for node template
This commit is contained in:
Keith Yeung
2022-09-29 23:48:10 +08:00
committed by GitHub
parent 7bea0c0175
commit a4fb1d7096
22 changed files with 323 additions and 107 deletions
@@ -957,7 +957,7 @@ mod tests {
#[test]
fn cannot_consume_too_much_future_weight() {
ExtBuilder::default()
.signed_weight(Weight::from_ref_time(40))
.signed_weight(Weight::from_ref_time(40).set_proof_size(u64::MAX))
.mock_weight_info(MockedWeightInfo::Basic)
.build_and_execute(|| {
roll_to(15);
@@ -973,11 +973,14 @@ mod tests {
// default solution will have 5 edges (5 * 5 + 10)
assert_eq!(solution_weight, Weight::from_ref_time(35));
assert_eq!(raw.solution.voter_count(), 5);
assert_eq!(<Runtime as Config>::SignedMaxWeight::get(), Weight::from_ref_time(40));
assert_eq!(
<Runtime as Config>::SignedMaxWeight::get(),
Weight::from_ref_time(40).set_proof_size(u64::MAX)
);
assert_ok!(MultiPhase::submit(RuntimeOrigin::signed(99), Box::new(raw.clone())));
<SignedMaxWeight>::set(Weight::from_ref_time(30));
<SignedMaxWeight>::set(Weight::from_ref_time(30).set_proof_size(u64::MAX));
// note: resubmitting the same solution is technically okay as long as the queue has
// space.