Skip to content

Commit

Permalink
Merge pull request #130 from radixdlt/bugfix/general-transaction-type
Browse files Browse the repository at this point in the history
Added a test for manifests with yield to child
  • Loading branch information
0xOmarA authored Dec 13, 2024
2 parents e350931 + 7978a88 commit 2ab5b35
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
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

0 comments on commit 2ab5b35

Please sign in to comment.