From 1dbe5632796c742b1ebecf6f5372f9302f5d96d3 Mon Sep 17 00:00:00 2001 From: Ivan Frolov Date: Fri, 20 Dec 2024 04:13:51 -0500 Subject: [PATCH] feat: decided which `finalize_transfer` to call based on token addr --- .../omni-connector/src/omni_connector.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/bridge-sdk/connectors/omni-connector/src/omni_connector.rs b/bridge-sdk/connectors/omni-connector/src/omni_connector.rs index b216159..007b969 100644 --- a/bridge-sdk/connectors/omni-connector/src/omni_connector.rs +++ b/bridge-sdk/connectors/omni-connector/src/omni_connector.rs @@ -515,10 +515,17 @@ impl OmniConnector { })?, }; - solana_bridge_client - .finalize_transfer(payload, solana_token) - .await - .map_err(|_| BridgeSdkError::UnknownError) + if solana_token == Pubkey::default() { + solana_bridge_client + .finalize_transfer_sol(payload) + .await + .map_err(|_| BridgeSdkError::UnknownError) + } else { + solana_bridge_client + .finalize_transfer(payload, solana_token) + .await + .map_err(|_| BridgeSdkError::UnknownError) + } } pub async fn log_metadata(&self, log_metadata_args: LogMetadataArgs) -> Result {