From 279c050a25543a0394fffe7818573a2d1d2d3acf Mon Sep 17 00:00:00 2001 From: Omar Abdulla Date: Thu, 6 Feb 2025 15:18:28 +0300 Subject: [PATCH] fix: fix the pool contribution classification. This commit fixes the pool contribution classification which was failing due to the account asset deposit withdraw requirement failing. This requirement failed because of assets that the analyzer has no certainty at all about. --- ...ithdrawn_are_not_deposited_back_requirement.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/crates/radix-engine-toolkit/src/manifest_analysis/requirements/account_resources_withdrawn_are_not_deposited_back_requirement.rs b/crates/radix-engine-toolkit/src/manifest_analysis/requirements/account_resources_withdrawn_are_not_deposited_back_requirement.rs index ab086688..bd3d1f02 100644 --- a/crates/radix-engine-toolkit/src/manifest_analysis/requirements/account_resources_withdrawn_are_not_deposited_back_requirement.rs +++ b/crates/radix-engine-toolkit/src/manifest_analysis/requirements/account_resources_withdrawn_are_not_deposited_back_requirement.rs @@ -104,7 +104,20 @@ impl ManifestAnalyzerRequirementState .iter() .filter_map(|(resource_address, resource)| { let bounds = resource.bounds(); - if bounds.is_zero() { + + // There are two cases that we ignore: the first is when + // the bounds inform us that none of the resource is on + // the worktop and the second is when the bounds give us + // completely no information at all about the resource + // meaning that the analyzer can't either tell if they + // are on the worktop or not. This manifests itself with + // a lower bound of zero and an upper bound that's + // unbounded. + let is_zero = bounds.is_zero(); + let is_completely_unknown = bounds.lower_bound() + == LowerBound::Inclusive(dec!(0)) + && bounds.upper_bound() == UpperBound::unbounded(); + if is_zero || is_completely_unknown { None } else { Some(*resource_address)