From e5bf6d12887c0baf0a342855a468b2a5966af02b Mon Sep 17 00:00:00 2001 From: Buffrr Date: Thu, 23 Jan 2025 18:03:07 +0100 Subject: [PATCH] Fix outbid sending a bid after open --- node/src/wallets.rs | 9 +++------ node/tests/integration_tests.rs | 10 +++++----- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/node/src/wallets.rs b/node/src/wallets.rs index 34f6978..bdfa70c 100644 --- a/node/src/wallets.rs +++ b/node/src/wallets.rs @@ -579,13 +579,10 @@ impl RpcWallet { continue; } - let foreign_input = match event.foreign_input { - None => continue, - Some(outpoint) => outpoint - }; - if foreign_input != space.outpoint() { - res.outbid.push(space); + if event.foreign_input.is_some_and(|input| input == space.outpoint()) { + continue; } + res.outbid.push(space); } } diff --git a/node/tests/integration_tests.rs b/node/tests/integration_tests.rs index 6063e40..d7266c0 100644 --- a/node/tests/integration_tests.rs +++ b/node/tests/integration_tests.rs @@ -105,11 +105,11 @@ async fn it_should_allow_outbidding(rig: &TestRig) -> anyhow::Result<()> { alice_spaces_updated.winning.len(), "alice must have one less space" ); - // assert_eq!( - // alices_spaces.outbid.len() + 1, - // alice_spaces_updated.outbid.len(), - // "alice must have one less space" - // ); + assert_eq!( + alices_spaces.outbid.len() + 1, + alice_spaces_updated.outbid.len(), + "alice must have one less space" + ); assert_eq!( bobs_spaces.winning.len() + 1, bob_spaces_updated.winning.len(),