From 483238051bbe14e151ff5ed628c7e07d172263bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Bald=C3=A9?= Date: Sat, 14 Dec 2024 03:37:25 +0000 Subject: [PATCH] Fix storage meter unit test for `fn nested` --- substrate/frame/revive/src/storage/meter.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/substrate/frame/revive/src/storage/meter.rs b/substrate/frame/revive/src/storage/meter.rs index 27113cf3a1a4..6621f8b9d500 100644 --- a/substrate/frame/revive/src/storage/meter.rs +++ b/substrate/frame/revive/src/storage/meter.rs @@ -725,13 +725,16 @@ mod tests { } #[test] + /// Previously, passing a limit of 0 meant unlimited storage for a nested call. + /// + /// Now, a limit of 0 means the subcall will not be able to use any storage. fn nested_zero_limit_requested() { clear_ext(); let meter = TestMeter::new(&Origin::from_account_id(ALICE), 1_000, 0).unwrap(); assert_eq!(meter.available(), 1_000); let nested0 = meter.nested(BalanceOf::::zero()); - assert_eq!(nested0.available(), 1_000); + assert_eq!(nested0.available(), 0); } #[test] @@ -751,7 +754,7 @@ mod tests { let meter = TestMeter::new(&Origin::from_account_id(ALICE), 1_000, 0).unwrap(); assert_eq!(meter.available(), 1_000); let nested0 = meter.nested(1_000); - assert_eq!(nested0.available(), 1_000); + assert_eq!(nested0.available(), 985); } #[test] @@ -761,7 +764,7 @@ mod tests { let meter = TestMeter::new(&Origin::from_account_id(ALICE), 1_000, 0).unwrap(); assert_eq!(meter.available(), 1_000); let nested0 = meter.nested(2_000); - assert_eq!(nested0.available(), 1_000); + assert_eq!(nested0.available(), 985); } #[test]