From 9061fa8cccdfd138ed4f7c6ef8c292043167e20f Mon Sep 17 00:00:00 2001 From: Omar Date: Fri, 13 Dec 2024 18:43:13 +0300 Subject: [PATCH 1/2] Added a test for manifests with yield to child --- .../tests/transaction_types.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/crates/radix-engine-toolkit/tests/transaction_types.rs b/crates/radix-engine-toolkit/tests/transaction_types.rs index c3b12196..b94d7ecc 100644 --- a/crates/radix-engine-toolkit/tests/transaction_types.rs +++ b/crates/radix-engine-toolkit/tests/transaction_types.rs @@ -2503,6 +2503,21 @@ fn account_locker_is_recognized_as_general_transaction() { assert_eq!(dynamic_analysis.new_entities, NewEntities::default()); } +#[test] +fn manifest_with_yield_to_child_has_no_classifications() { + // Arrange + let manifest = ManifestBuilder::new_v2() + .use_child("example", SubintentHash(Hash([0; 32]))) + .yield_to_child("example", ()) + .build(); + + // Act + let StaticAnalysis { classification, .. } = statically_analyze(&manifest); + + // Assert + assert!(classification.is_empty()); +} + #[test] fn lock_fee_manifest_has_no_classification_except_general() { // Arrange From 7978a88643f6b00040f9c1802217081942552d7e Mon Sep 17 00:00:00 2001 From: Omar Date: Fri, 13 Dec 2024 18:48:29 +0300 Subject: [PATCH 2/2] Add a comment to the added test --- .vscode/settings.json | 1 + crates/radix-engine-toolkit/tests/transaction_types.rs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/.vscode/settings.json b/.vscode/settings.json index 798acae5..e76ab27c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -36,6 +36,7 @@ "testcases", "thiserror", "typeshare", + "uncategorized", "unhashed", "uniffi", "unstake", diff --git a/crates/radix-engine-toolkit/tests/transaction_types.rs b/crates/radix-engine-toolkit/tests/transaction_types.rs index b94d7ecc..a42a1837 100644 --- a/crates/radix-engine-toolkit/tests/transaction_types.rs +++ b/crates/radix-engine-toolkit/tests/transaction_types.rs @@ -2503,6 +2503,11 @@ fn account_locker_is_recognized_as_general_transaction() { assert_eq!(dynamic_analysis.new_entities, NewEntities::default()); } +// This test ensures that a transaction intent manifest is classified as uncategorized in the Gateway +// The wallet currently uses the classification of the transaction intent manifest as the classification of the transaction +// For an MVP, we want the wallet to show transactions with subintents as Complex/Uncategorized, so this +// test checks that. In future, we may wish to revisit this and change this restriction, but we should make +// sure that the transactions still display reasonably in the wallet. #[test] fn manifest_with_yield_to_child_has_no_classifications() { // Arrange