Construct rental metadata regression fixture with typed receipt

This commit is contained in:
archipelago
2026-10-07 01:25:35 -04:00
parent 8389326c97
commit c2c4d9151c
+18 -9
View File
@@ -2622,15 +2622,24 @@ async fn rental_catalog_term_mismatch_never_plans_or_creates_buyer_intent() {
}; };
// Preparation checks already-verified signed metadata, without scanning bytes // Preparation checks already-verified signed metadata, without scanning bytes
// or allocating a quote. Keep this independent of the fake offer response. // or allocating a quote. Keep this independent of the fake offer response.
let metadata: crate::media_registration::Receipt = serde_json::from_value(json!({ let metadata = crate::media_registration::Receipt {
"version":1,"request_id":uuid::Uuid::new_v4().to_string(),"nonce":"fixture", version: 1,
"app_audience":"indeedhub","node_did":expected.seller_did, request_id: uuid::Uuid::new_v4().to_string(),
"producer":"fixture","project_id":"fixture","price_sats":8, nonce: "fixture".into(),
"viewing_seconds":60,"expires_at":now+300,"content_id":"registered_film", app_audience: "indeedhub".into(),
"sha256":"ab".repeat(32),"size_bytes":"16","payment_methods":["cashu"], node_did: expected.seller_did.clone(),
"issued_at":now,"signature":"verified by registration boundary" producer: "fixture".into(),
})) project_id: "fixture".into(),
.unwrap(); price_sats: 8,
viewing_seconds: 60,
expires_at: u64::try_from(now + 300).unwrap(),
content_id: "registered_film".into(),
sha256: "ab".repeat(32),
size_bytes: "16".into(),
payment_methods: vec!["cashu".into()],
issued_at: u64::try_from(now).unwrap(),
signature: "verified by registration boundary".into(),
};
expected expected
.verify_metadata(&expected.seller_did, &metadata) .verify_metadata(&expected.seller_did, &metadata)
.unwrap(); .unwrap();