fix feedback

This commit is contained in:
Roei Erez
2025-03-13 16:20:41 +02:00
parent 827c3ebb5d
commit acea488b7c
4 changed files with 7 additions and 29 deletions

View File

@@ -124,7 +124,7 @@ mod test {
recovered_data.derive_partial_state(Some(100000), None, false, true),
Some(PaymentState::WaitingFeeAcceptance)
);
// Expired - should be Refundable
// Expired without balance - should be Pending
assert_eq!(
recovered_data.derive_partial_state(Some(100000), None, true, false),
Some(PaymentState::Pending)

View File

@@ -4,7 +4,7 @@ mod test {
chain::liquid::MockLiquidChainService,
model::{PaymentState, ReceiveSwap, SwapMetadata},
recover::{
handlers::{tests::test::create_mock_wallet_tx, ReceiveSwapHandler},
handlers::{tests::test::create_mock_lbtc_wallet_tx, ReceiveSwapHandler},
model::{HistoryTxId, RecoveryContext, TxMap},
},
swapper::MockSwapper,
@@ -341,7 +341,7 @@ mod test {
.insert(claim_script.clone(), script_history);
// Create wallet tx
let wallet_tx = create_mock_wallet_tx(tx_id_hex, height, amount as i64);
let wallet_tx = create_mock_lbtc_wallet_tx(tx_id_hex, height, amount as i64);
// Add to incoming tx map
context
@@ -408,7 +408,7 @@ mod test {
.insert(mrh_script.clone(), script_history);
// Create wallet tx
let wallet_tx = create_mock_wallet_tx(tx_id_hex, height, amount as i64);
let wallet_tx = create_mock_lbtc_wallet_tx(tx_id_hex, height, amount as i64);
// Add to incoming tx map
context

View File

@@ -2,7 +2,7 @@
mod test {
use crate::chain::liquid::MockLiquidChainService;
use crate::prelude::*;
use crate::recover::handlers::tests::test::create_mock_wallet_tx;
use crate::recover::handlers::tests::test::create_mock_lbtc_wallet_tx;
use crate::recover::handlers::SendSwapHandler;
use crate::recover::model::*;
use crate::swapper::MockSwapper;
@@ -360,7 +360,7 @@ mod test {
.insert(script.clone(), script_history);
// Create wallet tx
let wallet_tx = create_mock_wallet_tx(tx_id_hex, height, -100000); // Negative amount for outgoing
let wallet_tx = create_mock_lbtc_wallet_tx(tx_id_hex, height, -100000); // Negative amount for outgoing
// Add to outgoing tx map
context.tx_map.outgoing_tx_map.insert(tx_id, wallet_tx);
@@ -425,7 +425,7 @@ mod test {
.insert(script.clone(), script_history);
// Create wallet tx
let wallet_tx = create_mock_wallet_tx(tx_id_hex, height, amount as i64); // Positive amount for incoming
let wallet_tx = create_mock_lbtc_wallet_tx(tx_id_hex, height, amount as i64); // Positive amount for incoming
// Add to incoming tx map
context

View File

@@ -48,28 +48,6 @@ mod test {
}
}
// Create a mock wallet transaction
pub(crate) fn create_mock_wallet_tx(tx_id_hex: &str, height: u32, amount: i64) -> WalletTx {
create_mock_lbtc_wallet_tx(tx_id_hex, height, amount)
// let tx_id = Txid::from_str(tx_id_hex).unwrap();
// // Create balance for the transaction
// let mut balance = BTreeMap::new();
// balance.insert(AssetId::default(), amount as i64);
// WalletTx {
// txid: tx_id,
// tx: create_empty_transaction(),
// height: Some(height),
// fee: 1000,
// timestamp: Some(1001), // Just after swap creation time
// balance,
// outputs: Vec::new(),
// inputs: Vec::new(),
// type_: "".to_string(),
// }
}
// Create a mock LBTC wallet transaction
pub(crate) fn create_mock_lbtc_wallet_tx(
tx_id_hex: &str,