Skip to content

Commit db87982

Browse files
authored
fix: one change call per sdk method (#212)
* fix: one change call per sdk method * chore: bumped versions
1 parent e1ad80f commit db87982

File tree

5 files changed

+6
-39
lines changed

5 files changed

+6
-39
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.17"
3+
version = "0.3.18"
44
edition = "2021"
55
repository = "https://github.com/Near-One/bridge-sdk-rs"
66

bridge-sdk/bridge-clients/near-bridge-client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "near-bridge-client"
3-
version = "0.2.5"
3+
version = "0.2.6"
44
edition = "2021"
55

66
[dependencies]

bridge-sdk/bridge-clients/near-bridge-client/src/btc.rs

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -369,32 +369,11 @@ impl NearBridgeClient {
369369
&self,
370370
chain: ChainKind,
371371
args: FinBtcTransferArgs,
372-
mut transaction_options: TransactionOptions,
372+
transaction_options: TransactionOptions,
373373
) -> Result<CryptoHash> {
374374
let endpoint = self.endpoint()?;
375375
let btc_connector = self.utxo_chain_connector(chain)?;
376376
let (method_name, deposit) = if args.deposit_msg.safe_deposit.is_some() {
377-
match self
378-
.get_required_storage_deposit(
379-
self.utxo_chain_token(chain)?,
380-
args.deposit_msg.recipient_id.clone(),
381-
)
382-
.await?
383-
{
384-
amount if amount > 0 => {
385-
self.storage_deposit_for_token(
386-
self.utxo_chain_token(chain)?,
387-
args.deposit_msg.recipient_id.clone(),
388-
amount,
389-
transaction_options.clone(),
390-
)
391-
.await?;
392-
393-
transaction_options.nonce = transaction_options.nonce.map(|nonce| nonce + 1);
394-
}
395-
_ => {}
396-
}
397-
398377
(
399378
"safe_verify_deposit".to_string(),
400379
BTC_SAFE_VERIFY_DEPOSIT_DEPOSIT,

bridge-sdk/bridge-clients/near-bridge-client/src/near_bridge_client.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -745,23 +745,11 @@ impl NearBridgeClient {
745745
let endpoint = self.endpoint()?;
746746
let omni_bridge_id = self.omni_bridge_id()?;
747747

748-
let required_balance = self.get_required_balance_for_fast_fin_transfer().await?
749-
+ args.storage_deposit_amount.unwrap_or(0);
750-
751-
let nonce = if self
752-
.deposit_storage_if_required(required_balance, transaction_options.clone())
753-
.await?
754-
{
755-
transaction_options.nonce.map(|nonce| nonce + 1)
756-
} else {
757-
transaction_options.nonce
758-
};
759-
760748
let tx_hash = near_rpc_client::change_and_wait(
761749
endpoint,
762750
ChangeRequest {
763751
signer: self.signer()?,
764-
nonce,
752+
nonce: transaction_options.nonce,
765753
receiver_id: args.token_id,
766754
method_name: "ft_transfer_call".to_string(),
767755
args: serde_json::json!({

0 commit comments

Comments
 (0)