diff --git a/src/routes/host/shared.rs b/src/routes/host/shared.rs index b3ce4ea..11b1c95 100644 --- a/src/routes/host/shared.rs +++ b/src/routes/host/shared.rs @@ -129,7 +129,7 @@ fn get_hosted_happ_invoice_details( let happ_name = read_happ_name(&human_readable_note).to_owned(); let InvoiceNote { - hha_id, + hha_id_string, invoice_period_start, invoice_period_end, invoiced_items, @@ -148,6 +148,14 @@ fn get_hosted_happ_invoice_details( } }; + let hha_id = match ActionHashB64::from_b64_str(&hha_id_string) { + Ok(hha_id) => hha_id, + Err(e) => { + warn!("Could not cast the hha_id_string in the invoice note into an ActionHash: {:?}", e); + return None; + } + }; + Some(TransactionAndInvoiceDetails { id, amount, @@ -368,7 +376,7 @@ struct Note(String, InvoiceNote); #[derive(Serialize, Deserialize, Debug)] #[serde(crate = "rocket::serde")] struct InvoiceNote { - hha_id: ActionHashB64, + hha_id_string: String, invoice_period_start: Timestamp, invoice_period_end: Timestamp, #[serde(flatten)]