From 7decfc9b0f2277a362c621e2bb886b5005514094 Mon Sep 17 00:00:00 2001 From: ahramy Date: Mon, 21 Oct 2024 16:11:52 -0700 Subject: [PATCH] fix(multisig-prover): update stellar gateway message definition (#664) Co-authored-by: Milap Sheth --- external-gateways/stellar/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/external-gateways/stellar/src/lib.rs b/external-gateways/stellar/src/lib.rs index 6ec121bed..66672aa9d 100644 --- a/external-gateways/stellar/src/lib.rs +++ b/external-gateways/stellar/src/lib.rs @@ -47,8 +47,8 @@ impl TryFrom for ScVal { #[derive(Debug, Clone)] pub struct Message { - pub message_id: String, pub source_chain: String, + pub message_id: String, pub source_address: String, pub contract_address: Contract, pub payload_hash: Hash, @@ -73,6 +73,7 @@ impl TryFrom<&router_api::Message> for Message { impl TryFrom for ScVal { type Error = XdrError; + // Note that XDR encodes the values in sorted order by key fn try_from(value: Message) -> Result { let keys: [&'static str; 5] = [ "contract_address", @@ -429,8 +430,8 @@ mod test { let messages: Messages = (1..=4) .map(|i| Message { - message_id: format!("test-{}", i), source_chain: format!("source-{}", i), + message_id: format!("test-{}", i), source_address: "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M" .to_string(), contract_address: "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMDR4"