diff --git a/crates/tbdex/src/messages/order_instructions.rs b/crates/tbdex/src/messages/order_instructions.rs index 0f703c9..6cea4e6 100644 --- a/crates/tbdex/src/messages/order_instructions.rs +++ b/crates/tbdex/src/messages/order_instructions.rs @@ -142,3 +142,26 @@ pub struct PaymentInstruction { #[serde(skip_serializing_if = "Option::is_none")] pub instruction: Option, } +#[cfg(test)] +mod tbdex_test_vectors_protocol { + use super::*; + use std::fs; + + #[derive(Debug, serde::Deserialize)] + pub struct OrderInstructionsTestVector { + pub input: String, + pub output: OrderInstructions, + } + + #[test] + fn parse_order_instructions() { + print!("~~RUNNING"); + let path = "../../tbdex/hosted/test-vectors/protocol/vectors/parse-orderinstructions.json"; + let test_vector_json: String = fs::read_to_string(path).unwrap(); + + let test_vector: OrderInstructionsTestVector = serde_json::from_str(&test_vector_json).unwrap(); + let parsed_order_instructions: OrderInstructions = OrderInstructions::from_json_string(&test_vector.input).unwrap(); + + assert_eq!(test_vector.output, parsed_order_instructions); + } +} \ No newline at end of file diff --git a/crates/tbdex/src/messages/quote.rs b/crates/tbdex/src/messages/quote.rs index dcba449..9a25d03 100644 --- a/crates/tbdex/src/messages/quote.rs +++ b/crates/tbdex/src/messages/quote.rs @@ -155,7 +155,6 @@ pub struct QuoteDetails { pub fee: Option, } -// TODO: Uncomment when we have parse_quote.json vector updated with no payment instructions #[cfg(test)] mod tbdex_test_vectors_protocol { use super::*;