From 85561bf4ddeca159a725e59d6ccc82799e421819 Mon Sep 17 00:00:00 2001 From: Rostyslav Tyshko Date: Fri, 25 Oct 2024 00:36:36 +0200 Subject: [PATCH] add test_create_utxo_from_payload --- utxo/src/utxo_core.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/utxo/src/utxo_core.rs b/utxo/src/utxo_core.rs index 432a012..bf20d4f 100644 --- a/utxo/src/utxo_core.rs +++ b/utxo/src/utxo_core.rs @@ -84,5 +84,16 @@ mod tests { } } + #[test] + fn test_create_utxo_from_payload() { + let payload = sample_payload(); + let utxo = UTXO::create_utxo_from_payload(payload.clone()); + + // Ensure hash is created and the UTXO fields are correctly assigned + assert_eq!(utxo.owner, payload.owner); + assert_eq!(utxo.asset, payload.asset); + assert!(utxo.nullifier.is_none()); + } + }