Skip to content

Commit b54618c

Browse files
densumeshcdxker
authored andcommitted
cleanup: rename update_user_balance to insert_pendign_deposit_transaction
1 parent b42aa3d commit b54618c

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

crates/node/src/handlers/deposit/create_deposit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl DepositIntentState {
138138
}
139139
}
140140

141-
pub async fn update_user_balance<N: Network, W: Wallet>(
141+
pub async fn insert_pending_deposit_transaction<N: Network, W: Wallet>(
142142
&mut self,
143143
node: &mut NodeState<N, W>,
144144
tx: &BitcoinTransaction,

crates/node/src/handlers/deposit/handler.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ impl<N: Network, W: Wallet> Handler<N, W> for DepositIntentState {
8484
request: SelfRequest::ConfirmDeposit { confirmed_tx },
8585
..
8686
} => {
87-
if let Err(e) = self.update_user_balance(node, &confirmed_tx).await {
87+
if let Err(e) = self
88+
.insert_pending_deposit_transaction(node, &confirmed_tx)
89+
.await
90+
{
8891
info!("❌ Failed to update user balance: {}", e);
8992
} else {
9093
info!(

tests/src/deposit/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ mod deposit_tests {
302302
};
303303

304304
state
305-
.update_user_balance(node, &tx)
305+
.insert_pending_deposit_transaction(node, &tx)
306306
.await
307307
.expect("balance update failed");
308308

@@ -408,7 +408,7 @@ mod deposit_tests {
408408
};
409409

410410
state
411-
.update_user_balance(node, &tx)
411+
.insert_pending_deposit_transaction(node, &tx)
412412
.await
413413
.expect("balance update failed");
414414

0 commit comments

Comments
 (0)