Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a test for manifests with yield to child #130

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"testcases",
"thiserror",
"typeshare",
"uncategorized",
"unhashed",
"uniffi",
"unstake",
Expand Down
20 changes: 20 additions & 0 deletions crates/radix-engine-toolkit/tests/transaction_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2503,6 +2503,26 @@ 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
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
Expand Down
Loading