From bb18ef3efac44d55e87aa6de6866327b91ed7bcb Mon Sep 17 00:00:00 2001 From: Justin Kilpatrick Date: Wed, 19 May 2021 10:08:46 -0400 Subject: [PATCH] Handle prefixes during deposit events This patch helps handle prefixes during deposit events and ensure we don't relay a cosmos address instead of an althea one. --- orchestrator/cosmos_gravity/src/send.rs | 2 +- orchestrator/orchestrator/src/ethereum_event_watcher.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/orchestrator/cosmos_gravity/src/send.rs b/orchestrator/cosmos_gravity/src/send.rs index 8727e8ac1..594880340 100644 --- a/orchestrator/cosmos_gravity/src/send.rs +++ b/orchestrator/cosmos_gravity/src/send.rs @@ -296,7 +296,7 @@ pub async fn send_ethereum_claims( block_height: downcast_uint256(deposit.block_height).unwrap(), token_contract: deposit.erc20.to_string(), amount: deposit.amount.to_string(), - cosmos_receiver: deposit.destination.to_string(), + cosmos_receiver: deposit.destination.to_bech32(contact.get_prefix()).unwrap(), ethereum_sender: deposit.sender.to_string(), orchestrator: our_address.to_string(), }; diff --git a/orchestrator/orchestrator/src/ethereum_event_watcher.rs b/orchestrator/orchestrator/src/ethereum_event_watcher.rs index e0fb4f749..6c80fb323 100644 --- a/orchestrator/orchestrator/src/ethereum_event_watcher.rs +++ b/orchestrator/orchestrator/src/ethereum_event_watcher.rs @@ -127,7 +127,7 @@ pub async fn check_for_events( if !deposits.is_empty() { info!( "Oracle observed deposit with sender {}, destination {}, amount {}, and event nonce {}", - deposits[0].sender, deposits[0].destination, deposits[0].amount, deposits[0].event_nonce + deposits[0].sender, deposits[0].destination.to_bech32(contact.get_prefix()).unwrap(), deposits[0].amount, deposits[0].event_nonce ) } if !withdraws.is_empty() {