Skip to content

Commit

Permalink
Remove usage of 0 as unlimited storage meter in test
Browse files Browse the repository at this point in the history
  • Loading branch information
rockbmb committed Dec 17, 2024
1 parent 4832380 commit 2c33d23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions substrate/frame/contracts/src/storage/meter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ mod tests {
let mut meter = TestMeter::new(&test_case.origin, Some(1_000), 0).unwrap();
assert_eq!(meter.available(), 1_000);

let mut nested0 = meter.nested(BalanceOf::<Test>::zero());
let mut nested0 = meter.nested(BalanceOf::<Test>::max_value());
nested0.charge(&Diff {
bytes_added: 5,
bytes_removed: 1,
Expand All @@ -893,7 +893,7 @@ mod tests {
bytes_deposit: 100,
items_deposit: 20,
});
let mut nested1 = nested0.nested(BalanceOf::<Test>::zero());
let mut nested1 = nested0.nested(BalanceOf::<Test>::max_value());
nested1.charge(&Diff { items_removed: 5, ..Default::default() });
nested1.charge(&Diff { bytes_added: 20, ..Default::default() });
nested1.terminate(&nested1_info, CHARLIE);
Expand Down
4 changes: 2 additions & 2 deletions substrate/frame/revive/src/storage/meter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ mod tests {
let mut meter = TestMeter::new(&test_case.origin, 1_000, 0).unwrap();
assert_eq!(meter.available(), 1_000);

let mut nested0 = meter.nested(BalanceOf::<Test>::zero());
let mut nested0 = meter.nested(BalanceOf::<Test>::max_value());
nested0.charge(&Diff {
bytes_added: 5,
bytes_removed: 1,
Expand All @@ -938,7 +938,7 @@ mod tests {
items_deposit: 20,
immutable_data_len: 0,
});
let mut nested1 = nested0.nested(BalanceOf::<Test>::zero());
let mut nested1 = nested0.nested(BalanceOf::<Test>::max_value());
nested1.charge(&Diff { items_removed: 5, ..Default::default() });
nested1.charge(&Diff { bytes_added: 20, ..Default::default() });
nested1.terminate(&nested1_info, CHARLIE);
Expand Down

0 comments on commit 2c33d23

Please sign in to comment.