From 8b0cb99503f178b128727bddca80a57d164fb43d Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Tue, 7 Jul 2026 13:03:40 +0700 Subject: [PATCH] test(platform-wallet): fund wallet fixture with a chain-locked tx rust-dashcore#836 (in the 647fa98 bump, #4022) restricts asset-lock coin selection to final inputs (confirmed or InstantSend-locked), so the mempool-funded funded_wallet_manager fixture left the three asset-lock broadcast tests with no eligible UTXO and they failed with "No UTXOs available for selection" on every v4.1-dev PR. Fund the fixture UTXO via an InChainLockedBlock context instead so it is final, matching what the asset-lock builder now requires. Co-Authored-By: Claude Fable 5 --- packages/rs-platform-wallet/src/test_support.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/rs-platform-wallet/src/test_support.rs b/packages/rs-platform-wallet/src/test_support.rs index 4b7f525cd24..51b76637af9 100644 --- a/packages/rs-platform-wallet/src/test_support.rs +++ b/packages/rs-platform-wallet/src/test_support.rs @@ -9,12 +9,14 @@ use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; use async_trait::async_trait; +use dashcore::hashes::Hash; use dashcore::secp256k1::{ecdsa, Message, PublicKey, Secp256k1}; +use dashcore::BlockHash; use dashcore::{Network, Transaction, Txid}; use key_wallet::account::account_type::StandardAccountType; use key_wallet::signer::{Signer, SignerMethod}; use key_wallet::test_utils::TestWalletContext; -use key_wallet::transaction_checking::TransactionContext; +use key_wallet::transaction_checking::{BlockInfo, TransactionContext}; use key_wallet::{DerivationPath, Wallet}; use key_wallet_manager::WalletManager; use tokio::sync::RwLock; @@ -155,8 +157,19 @@ pub(crate) async fn funded_wallet_manager( }; let funding_tx = Transaction::dummy(&receive_address, 0..1, &[10_000_000]); + // Chain-locked funding, not `Mempool`: asset-lock builders only + // select final (confirmed / InstantSend-locked) inputs since + // rust-dashcore#836, so a mempool-funded fixture leaves the + // asset-lock tests with no eligible UTXO. let result = ctx - .check_transaction(&funding_tx, TransactionContext::Mempool) + .check_transaction( + &funding_tx, + TransactionContext::InChainLockedBlock(BlockInfo::new( + 1, + BlockHash::all_zeros(), + 1_700_000_000, + )), + ) .await; assert!( result.is_relevant,