From 435f2e9e02e7f2397d6497b724e5dc48961c442b Mon Sep 17 00:00:00 2001 From: "Jamil Lambert, PhD" Date: Tue, 26 Aug 2025 10:22:33 +0100 Subject: [PATCH 1/3] fix utxoupdatepsbt client macro The macro had a typo and returned the incorrect type. Fix the typo and return the correct type. --- client/src/client_sync/v18/raw_transactions.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/client_sync/v18/raw_transactions.rs b/client/src/client_sync/v18/raw_transactions.rs index aecf3c10..5211495f 100644 --- a/client/src/client_sync/v18/raw_transactions.rs +++ b/client/src/client_sync/v18/raw_transactions.rs @@ -35,14 +35,14 @@ macro_rules! impl_client_v18__join_psbts { }; } -/// Implements Bitcoin Core JSON-RPC API method `uxtoupdatepsbt`. +/// Implements Bitcoin Core JSON-RPC API method `utxoupdatepsbt`. #[macro_export] macro_rules! impl_client_v18__utxo_update_psbt { () => { impl Client { - pub fn utxo_update_psbt(&self, psbt: &bitcoin::Psbt) -> Result { + pub fn utxo_update_psbt(&self, psbt: &bitcoin::Psbt) -> Result { let psbt = format!("{}", psbt); - self.call("uxtoupdatepsbt", &[psbt.into()]) + self.call("utxoupdatepsbt", &[psbt.into()]) } } }; From e2006585e29706dbf64c89a8fa0fb3e6a36930ff Mon Sep 17 00:00:00 2001 From: "Jamil Lambert, PhD" Date: Tue, 26 Aug 2025 12:22:43 +0100 Subject: [PATCH 2/3] Test utxoupdatepsbt `utxoupdatepsbt` is implemented but untested. There are no return changes up to v29. Add a test and update the types table. --- integration_test/tests/raw_transactions.rs | 16 ++++++++++++++-- types/src/v18/mod.rs | 2 +- types/src/v19/mod.rs | 2 +- types/src/v20/mod.rs | 2 +- types/src/v21/mod.rs | 2 +- types/src/v22/mod.rs | 2 +- types/src/v23/mod.rs | 2 +- types/src/v24/mod.rs | 2 +- types/src/v25/mod.rs | 2 +- types/src/v26/mod.rs | 2 +- types/src/v27/mod.rs | 2 +- types/src/v28/mod.rs | 2 +- types/src/v29/mod.rs | 2 +- 13 files changed, 26 insertions(+), 14 deletions(-) diff --git a/integration_test/tests/raw_transactions.rs b/integration_test/tests/raw_transactions.rs index c37b3172..d022985e 100644 --- a/integration_test/tests/raw_transactions.rs +++ b/integration_test/tests/raw_transactions.rs @@ -412,8 +412,20 @@ fn raw_transactions__test_mempool_accept__modelled() { } #[test] -#[cfg(not(feature = "v17"))] // utxoupdatepsbt was added in v0.18. -fn raw_transactions__utxo_update_psbt() {} +#[cfg(not(feature = "v17"))] +fn raw_transactions__utxo_update_psbt__modelled() { + let node = Node::with_wallet(Wallet::Default, &[]); + node.fund_wallet(); + + let psbt = create_a_psbt(&node); + let json: UtxoUpdatePsbt = node + .client + .utxo_update_psbt(&psbt) + .expect("utxoupdatepsbt"); + let model: mtype::UtxoUpdatePsbt = json.into_model().expect("UtxoUpdatePsbt into model"); + + assert!(model.0.inputs.len() >= psbt.inputs.len()); +} // Manipulates raw transactions. // diff --git a/types/src/v18/mod.rs b/types/src/v18/mod.rs index 62dda715..cb6dd57c 100644 --- a/types/src/v18/mod.rs +++ b/types/src/v18/mod.rs @@ -133,7 +133,7 @@ //! | sendrawtransaction | version + model | | //! | signrawtransactionwithkey | version + model | | //! | testmempoolaccept | version + model | | -//! | utxoupdatepsbt | version + model | UNTESTED | +//! | utxoupdatepsbt | version + model | | //! //! //! diff --git a/types/src/v19/mod.rs b/types/src/v19/mod.rs index b23e23c8..0629b3a4 100644 --- a/types/src/v19/mod.rs +++ b/types/src/v19/mod.rs @@ -133,7 +133,7 @@ //! | sendrawtransaction | version + model | | //! | signrawtransactionwithkey | version + model | | //! | testmempoolaccept | version + model | | -//! | utxoupdatepsbt | version + model | UNTESTED | +//! | utxoupdatepsbt | version + model | | //! //! //! diff --git a/types/src/v20/mod.rs b/types/src/v20/mod.rs index db662c99..eff980dd 100644 --- a/types/src/v20/mod.rs +++ b/types/src/v20/mod.rs @@ -134,7 +134,7 @@ //! | sendrawtransaction | version + model | | //! | signrawtransactionwithkey | version + model | | //! | testmempoolaccept | version + model | | -//! | utxoupdatepsbt | version + model | UNTESTED | +//! | utxoupdatepsbt | version + model | | //! //! //! diff --git a/types/src/v21/mod.rs b/types/src/v21/mod.rs index 9b404038..d457b3c1 100644 --- a/types/src/v21/mod.rs +++ b/types/src/v21/mod.rs @@ -135,7 +135,7 @@ //! | sendrawtransaction | version + model | | //! | signrawtransactionwithkey | version + model | | //! | testmempoolaccept | version + model | | -//! | utxoupdatepsbt | version + model | UNTESTED | +//! | utxoupdatepsbt | version + model | | //! //! //! diff --git a/types/src/v22/mod.rs b/types/src/v22/mod.rs index 95f6225e..fc33c2fa 100644 --- a/types/src/v22/mod.rs +++ b/types/src/v22/mod.rs @@ -135,7 +135,7 @@ //! | sendrawtransaction | version + model | | //! | signrawtransactionwithkey | version + model | | //! | testmempoolaccept | version + model | | -//! | utxoupdatepsbt | version + model | UNTESTED | +//! | utxoupdatepsbt | version + model | | //! //! //! diff --git a/types/src/v23/mod.rs b/types/src/v23/mod.rs index 2d7b6e48..85d0f9fb 100644 --- a/types/src/v23/mod.rs +++ b/types/src/v23/mod.rs @@ -126,7 +126,7 @@ //! | sendrawtransaction | version + model | | //! | signrawtransactionwithkey | version + model | | //! | testmempoolaccept | version + model | | -//! | utxoupdatepsbt | version + model | UNTESTED | +//! | utxoupdatepsbt | version + model | | //! //! //! diff --git a/types/src/v24/mod.rs b/types/src/v24/mod.rs index 2a9fbd3f..a7ffe1c6 100644 --- a/types/src/v24/mod.rs +++ b/types/src/v24/mod.rs @@ -127,7 +127,7 @@ //! | sendrawtransaction | version + model | | //! | signrawtransactionwithkey | version + model | | //! | testmempoolaccept | version + model | | -//! | utxoupdatepsbt | version + model | UNTESTED | +//! | utxoupdatepsbt | version + model | | //! //! //! diff --git a/types/src/v25/mod.rs b/types/src/v25/mod.rs index a49d4743..5fd5d3bd 100644 --- a/types/src/v25/mod.rs +++ b/types/src/v25/mod.rs @@ -128,7 +128,7 @@ //! | sendrawtransaction | version + model | | //! | signrawtransactionwithkey | version + model | | //! | testmempoolaccept | version + model | | -//! | utxoupdatepsbt | version + model | UNTESTED | +//! | utxoupdatepsbt | version + model | | //! //! //! diff --git a/types/src/v26/mod.rs b/types/src/v26/mod.rs index 31af8770..73b6edae 100644 --- a/types/src/v26/mod.rs +++ b/types/src/v26/mod.rs @@ -136,7 +136,7 @@ //! | signrawtransactionwithkey | version + model | | //! | submitpackage | version + model | | //! | testmempoolaccept | version + model | | -//! | utxoupdatepsbt | version + model | UNTESTED | +//! | utxoupdatepsbt | version + model | | //! //! //! diff --git a/types/src/v27/mod.rs b/types/src/v27/mod.rs index 9fbebc08..11148a3b 100644 --- a/types/src/v27/mod.rs +++ b/types/src/v27/mod.rs @@ -136,7 +136,7 @@ //! | signrawtransactionwithkey | version + model | | //! | submitpackage | version + model | | //! | testmempoolaccept | version + model | | -//! | utxoupdatepsbt | version + model | UNTESTED | +//! | utxoupdatepsbt | version + model | | //! //! //! diff --git a/types/src/v28/mod.rs b/types/src/v28/mod.rs index 3e300966..38a63b42 100644 --- a/types/src/v28/mod.rs +++ b/types/src/v28/mod.rs @@ -136,7 +136,7 @@ //! | signrawtransactionwithkey | version + model | | //! | submitpackage | version + model | | //! | testmempoolaccept | version + model | | -//! | utxoupdatepsbt | version + model | UNTESTED | +//! | utxoupdatepsbt | version + model | | //! //! //! diff --git a/types/src/v29/mod.rs b/types/src/v29/mod.rs index 295bff69..85eb7d75 100644 --- a/types/src/v29/mod.rs +++ b/types/src/v29/mod.rs @@ -137,7 +137,7 @@ //! | signrawtransactionwithkey | version + model | | //! | submitpackage | version + model | | //! | testmempoolaccept | version + model | | -//! | utxoupdatepsbt | version + model | UNTESTED | +//! | utxoupdatepsbt | version + model | | //! //! //! From 475e4494ff99781e912d124a3af9faebd684f720 Mon Sep 17 00:00:00 2001 From: "Jamil Lambert, PhD" Date: Tue, 26 Aug 2025 12:25:21 +0100 Subject: [PATCH 3/3] Test joinpsbts `joinpsbts` is implemented but untested. There are no return changes up to v29. Add a test and update the types table --- integration_test/tests/raw_transactions.rs | 18 ++++++++++++++++++ types/src/v18/mod.rs | 2 +- types/src/v19/mod.rs | 2 +- types/src/v20/mod.rs | 2 +- types/src/v21/mod.rs | 2 +- types/src/v22/mod.rs | 2 +- types/src/v23/mod.rs | 2 +- types/src/v24/mod.rs | 2 +- types/src/v25/mod.rs | 2 +- types/src/v26/mod.rs | 2 +- types/src/v27/mod.rs | 2 +- types/src/v28/mod.rs | 2 +- types/src/v29/mod.rs | 2 +- 13 files changed, 30 insertions(+), 12 deletions(-) diff --git a/integration_test/tests/raw_transactions.rs b/integration_test/tests/raw_transactions.rs index d022985e..99b69678 100644 --- a/integration_test/tests/raw_transactions.rs +++ b/integration_test/tests/raw_transactions.rs @@ -309,6 +309,24 @@ fn raw_transactions__get_raw_transaction__modelled() { } +#[test] +#[cfg(not(feature = "v17"))] +fn raw_transactions__join_psbts__modelled() { + let node = Node::with_wallet(Wallet::Default, &[]); + node.fund_wallet(); + + let psbt1 = create_a_psbt(&node); + let psbt2 = create_a_psbt(&node); + + let json: JoinPsbts = node + .client + .join_psbts(&[psbt1.clone(), psbt2.clone()]) + .expect("joinpsbts"); + let model: mtype::JoinPsbts = json.into_model().expect("JoinPsbts into model"); + + assert_eq!(model.0.inputs.len(), psbt1.inputs.len() + psbt2.inputs.len()); +} + #[test] fn raw_transactions__sign_raw_transaction__modelled() { let node = Node::with_wallet(Wallet::Default, &[]); diff --git a/types/src/v18/mod.rs b/types/src/v18/mod.rs index cb6dd57c..54226b8c 100644 --- a/types/src/v18/mod.rs +++ b/types/src/v18/mod.rs @@ -129,7 +129,7 @@ //! | finalizepsbt | version + model | | //! | fundrawtransaction | version + model | | //! | getrawtransaction | version + model | Includes additional 'verbose' type | -//! | joinpsbts | version + model | UNTESTED | +//! | joinpsbts | version + model | | //! | sendrawtransaction | version + model | | //! | signrawtransactionwithkey | version + model | | //! | testmempoolaccept | version + model | | diff --git a/types/src/v19/mod.rs b/types/src/v19/mod.rs index 0629b3a4..bc307de5 100644 --- a/types/src/v19/mod.rs +++ b/types/src/v19/mod.rs @@ -129,7 +129,7 @@ //! | finalizepsbt | version + model | | //! | fundrawtransaction | version + model | | //! | getrawtransaction | version + model | Includes additional 'verbose' type | -//! | joinpsbts | version + model | UNTESTED | +//! | joinpsbts | version + model | | //! | sendrawtransaction | version + model | | //! | signrawtransactionwithkey | version + model | | //! | testmempoolaccept | version + model | | diff --git a/types/src/v20/mod.rs b/types/src/v20/mod.rs index eff980dd..a4dffa39 100644 --- a/types/src/v20/mod.rs +++ b/types/src/v20/mod.rs @@ -130,7 +130,7 @@ //! | finalizepsbt | version + model | | //! | fundrawtransaction | version + model | | //! | getrawtransaction | version + model | Includes additional 'verbose' type | -//! | joinpsbts | version + model | UNTESTED | +//! | joinpsbts | version + model | | //! | sendrawtransaction | version + model | | //! | signrawtransactionwithkey | version + model | | //! | testmempoolaccept | version + model | | diff --git a/types/src/v21/mod.rs b/types/src/v21/mod.rs index d457b3c1..9bf39a2b 100644 --- a/types/src/v21/mod.rs +++ b/types/src/v21/mod.rs @@ -131,7 +131,7 @@ //! | finalizepsbt | version + model | | //! | fundrawtransaction | version + model | | //! | getrawtransaction | version + model | Includes additional 'verbose' type | -//! | joinpsbts | version + model | UNTESTED | +//! | joinpsbts | version + model | | //! | sendrawtransaction | version + model | | //! | signrawtransactionwithkey | version + model | | //! | testmempoolaccept | version + model | | diff --git a/types/src/v22/mod.rs b/types/src/v22/mod.rs index fc33c2fa..2d213b16 100644 --- a/types/src/v22/mod.rs +++ b/types/src/v22/mod.rs @@ -131,7 +131,7 @@ //! | finalizepsbt | version + model | | //! | fundrawtransaction | version + model | | //! | getrawtransaction | version + model | Includes additional 'verbose' type | -//! | joinpsbts | version + model | UNTESTED | +//! | joinpsbts | version + model | | //! | sendrawtransaction | version + model | | //! | signrawtransactionwithkey | version + model | | //! | testmempoolaccept | version + model | | diff --git a/types/src/v23/mod.rs b/types/src/v23/mod.rs index 85d0f9fb..0abafa0e 100644 --- a/types/src/v23/mod.rs +++ b/types/src/v23/mod.rs @@ -122,7 +122,7 @@ //! | finalizepsbt | version + model | | //! | fundrawtransaction | version + model | | //! | getrawtransaction | version + model | Includes additional 'verbose' type | -//! | joinpsbts | version + model | UNTESTED | +//! | joinpsbts | version + model | | //! | sendrawtransaction | version + model | | //! | signrawtransactionwithkey | version + model | | //! | testmempoolaccept | version + model | | diff --git a/types/src/v24/mod.rs b/types/src/v24/mod.rs index a7ffe1c6..93892fb0 100644 --- a/types/src/v24/mod.rs +++ b/types/src/v24/mod.rs @@ -123,7 +123,7 @@ //! | finalizepsbt | version + model | | //! | fundrawtransaction | version + model | | //! | getrawtransaction | version + model | Includes additional 'verbose' type | -//! | joinpsbts | version + model | UNTESTED | +//! | joinpsbts | version + model | | //! | sendrawtransaction | version + model | | //! | signrawtransactionwithkey | version + model | | //! | testmempoolaccept | version + model | | diff --git a/types/src/v25/mod.rs b/types/src/v25/mod.rs index 5fd5d3bd..41e95511 100644 --- a/types/src/v25/mod.rs +++ b/types/src/v25/mod.rs @@ -124,7 +124,7 @@ //! | finalizepsbt | version + model | | //! | fundrawtransaction | version + model | | //! | getrawtransaction | version + model | Includes additional 'verbose' type | -//! | joinpsbts | version + model | UNTESTED | +//! | joinpsbts | version + model | | //! | sendrawtransaction | version + model | | //! | signrawtransactionwithkey | version + model | | //! | testmempoolaccept | version + model | | diff --git a/types/src/v26/mod.rs b/types/src/v26/mod.rs index 73b6edae..817bbb99 100644 --- a/types/src/v26/mod.rs +++ b/types/src/v26/mod.rs @@ -131,7 +131,7 @@ //! | finalizepsbt | version + model | | //! | fundrawtransaction | version + model | | //! | getrawtransaction | version + model | Includes additional 'verbose' type | -//! | joinpsbts | version + model | UNTESTED | +//! | joinpsbts | version + model | | //! | sendrawtransaction | version + model | | //! | signrawtransactionwithkey | version + model | | //! | submitpackage | version + model | | diff --git a/types/src/v27/mod.rs b/types/src/v27/mod.rs index 11148a3b..b4e33f4d 100644 --- a/types/src/v27/mod.rs +++ b/types/src/v27/mod.rs @@ -131,7 +131,7 @@ //! | finalizepsbt | version + model | | //! | fundrawtransaction | version + model | | //! | getrawtransaction | version + model | Includes additional 'verbose' type | -//! | joinpsbts | version + model | UNTESTED | +//! | joinpsbts | version + model | | //! | sendrawtransaction | version + model | | //! | signrawtransactionwithkey | version + model | | //! | submitpackage | version + model | | diff --git a/types/src/v28/mod.rs b/types/src/v28/mod.rs index 38a63b42..0ae062d1 100644 --- a/types/src/v28/mod.rs +++ b/types/src/v28/mod.rs @@ -131,7 +131,7 @@ //! | finalizepsbt | version + model | | //! | fundrawtransaction | version + model | | //! | getrawtransaction | version + model | Includes additional 'verbose' type | -//! | joinpsbts | version + model | UNTESTED | +//! | joinpsbts | version + model | | //! | sendrawtransaction | version + model | | //! | signrawtransactionwithkey | version + model | | //! | submitpackage | version + model | | diff --git a/types/src/v29/mod.rs b/types/src/v29/mod.rs index 85eb7d75..0e9bbf18 100644 --- a/types/src/v29/mod.rs +++ b/types/src/v29/mod.rs @@ -132,7 +132,7 @@ //! | finalizepsbt | version + model | | //! | fundrawtransaction | version + model | | //! | getrawtransaction | version + model | Includes additional 'verbose' type | -//! | joinpsbts | version + model | UNTESTED | +//! | joinpsbts | version + model | | //! | sendrawtransaction | version + model | | //! | signrawtransactionwithkey | version + model | | //! | submitpackage | version + model | |