Skip to content

Commit 0004fcd

Browse files
authored
Fix: enable orchard bundle only for ZCash (#250)
* fix btc * update version
1 parent a71bda4 commit 0004fcd

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bridge-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bridge-cli"
3-
version = "0.3.38"
3+
version = "0.3.39"
44
edition = "2021"
55
repository = "https://github.com/Near-One/bridge-sdk-rs"
66
rust-version = "1.88.0"

bridge-sdk/connectors/omni-connector/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "omni-connector"
3-
version = "0.3.5"
3+
version = "0.3.6"
44
edition = "2021"
55
rust-version = "1.88.0"
66

bridge-sdk/connectors/omni-connector/src/omni_connector.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ impl OmniConnector {
670670
amount: u128,
671671
transaction_options: TransactionOptions,
672672
) -> Result<CryptoHash> {
673-
let enable_orchard = self.get_orchard_mode(&target_btc_address)?;
673+
let enable_orchard = self.get_orchard_mode(&target_btc_address, chain)?;
674674
let utxo_bridge_client = self.utxo_bridge_client(chain)?;
675675
let fee_rate = utxo_bridge_client.get_fee_rate().await?;
676676

@@ -762,7 +762,7 @@ impl OmniConnector {
762762
transaction_options: TransactionOptions,
763763
max_gas_fee: Option<u64>,
764764
) -> Result<CryptoHash> {
765-
let enable_orchard = self.get_orchard_mode(&recipient)?;
765+
let enable_orchard = self.get_orchard_mode(&recipient, chain)?;
766766
let near_bridge_client = self.near_bridge_client()?;
767767
let fee = near_bridge_client.get_withdraw_fee(chain).await?;
768768
let (out_points, tx_outs, chain_specific_data, gas_fee) = self
@@ -2007,7 +2007,11 @@ impl OmniConnector {
20072007
wormhole_bridge_client.get_vaa_by_tx_hash(tx_hash).await
20082008
}
20092009

2010-
pub fn get_orchard_mode(&self, target_btc_address: &str) -> Result<bool> {
2010+
pub fn get_orchard_mode(&self, target_btc_address: &str, chain: ChainKind) -> Result<bool> {
2011+
if chain != ChainKind::Zcash {
2012+
return Ok(false);
2013+
}
2014+
20112015
let has_orchard = utxo_utils::contains_orchard_address(target_btc_address)
20122016
.map_err(|err| BridgeSdkError::InvalidArgument(format!("Invalid address: {err}")))?;
20132017

rust-toolchain

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "1.88.0"
3-
components = ["clippy", "rustfmt"]
2+
channel = "1.93.0"
3+
components = ["clippy", "rustfmt"]

0 commit comments

Comments
 (0)