From 150652c7791a86a950600fb98dd788664322c66f Mon Sep 17 00:00:00 2001 From: Rostyslav Tyshko Date: Fri, 25 Oct 2024 00:37:02 +0200 Subject: [PATCH] add test_interpret_asset --- utxo/src/utxo_core.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/utxo/src/utxo_core.rs b/utxo/src/utxo_core.rs index 250daedc..1be43226 100644 --- a/utxo/src/utxo_core.rs +++ b/utxo/src/utxo_core.rs @@ -111,4 +111,16 @@ mod tests { assert!(result.is_err()); } + #[test] + fn test_interpret_asset() { + let payload = sample_payload(); + let utxo = UTXO::create_utxo_from_payload(payload); + + // Interpret asset as TestAsset + let interpreted: TestAsset = utxo.interpret_asset().unwrap(); + + assert_eq!(interpreted, TestAsset { id: 1, name: "Test".to_string() }); + } + + }