Skip to content

Test listlabels #331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions integration_test/tests/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,17 @@ fn wallet__list_address_groupings__modelled() {
assert!(!groupings.0.is_empty());
}

#[test]
fn wallet__list_labels__modelled() {
let node = Node::with_wallet(Wallet::Default, &[]);
let label = "list-label-test";
let _ = node.client.new_address_with_label(label).expect("newaddress");

let json: ListLabels = node.client.list_labels().expect("listlabels");

assert!(json.0.iter().any(|s| s == label));
}

#[cfg(not(feature = "v17"))]
#[test]
fn wallet__list_received_by_label__modelled() {
Expand Down
14 changes: 7 additions & 7 deletions types/src/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ pub use self::{
GetBalance, GetBalances, GetBalancesMine, GetBalancesWatchOnly, GetHdKeys, GetNewAddress,
GetRawChangeAddress, GetReceivedByAddress, GetReceivedByLabel, GetTransaction,
GetTransactionDetail, GetUnconfirmedBalance, GetWalletInfo, HdKey, HdKeyDescriptor,
LastProcessedBlock, ListAddressGroupings, ListAddressGroupingsItem, ListLabels,
ListLockUnspent, ListLockUnspentItem, ListReceivedByAddress, ListReceivedByAddressItem,
ListReceivedByLabel, ListReceivedByLabelItem, ListSinceBlock, ListSinceBlockTransaction,
ListTransactions, ListTransactionsItem, ListUnspent, ListUnspentItem, ListWallets,
LoadWallet, PsbtBumpFee, RescanBlockchain, ScriptType, Send, SendAll, SendMany,
SendToAddress, SignMessage, SimulateRawTransaction, TransactionCategory, UnloadWallet,
WalletCreateFundedPsbt, WalletDisplayAddress, WalletProcessPsbt,
LastProcessedBlock, ListAddressGroupings, ListAddressGroupingsItem, ListLockUnspent,
ListLockUnspentItem, ListReceivedByAddress, ListReceivedByAddressItem, ListReceivedByLabel,
ListReceivedByLabelItem, ListSinceBlock, ListSinceBlockTransaction, ListTransactions,
ListTransactionsItem, ListUnspent, ListUnspentItem, ListWallets, LoadWallet, PsbtBumpFee,
RescanBlockchain, ScriptType, Send, SendAll, SendMany, SendToAddress, SignMessage,
SimulateRawTransaction, TransactionCategory, UnloadWallet, WalletCreateFundedPsbt,
WalletDisplayAddress, WalletProcessPsbt,
},
};
5 changes: 0 additions & 5 deletions types/src/model/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,11 +499,6 @@ pub struct ListAddressGroupingsItem {
pub label: Option<String>,
}

/// Models the result of JSON-RPC method `listlabels`.
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
#[serde(deny_unknown_fields)]
pub struct ListLabels(pub Vec<String>);

/// Models the result of JSON-RPC method `listlockunspent`.
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
#[serde(deny_unknown_fields)]
Expand Down
2 changes: 1 addition & 1 deletion types/src/v17/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
//! | keypoolrefill | returns nothing | |
//! | listaccounts | returns nothing | |
//! | listaddressgroupings | version + model | UNTESTED |
//! | listlabels | version + model | UNTESTED |
//! | listlabels | version | |
//! | listlockunspent | version + model | UNTESTED |
//! | listreceivedbyaccount | returns nothing | |
//! | listreceivedbyaddress | version + model | UNTESTED |
Expand Down
4 changes: 0 additions & 4 deletions types/src/v17/wallet/into.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,10 +485,6 @@ impl ListAddressGroupingsItem {
}
}

impl ListLabels {
pub fn into_model(self) -> model::ListLabels { model::ListLabels(self.0) }
}

impl ListLockUnspent {
/// Converts version specific type to a version nonspecific, more strongly typed type.
pub fn into_model(self) -> Result<model::ListLockUnspent, ListLockUnspentItemError> {
Expand Down
2 changes: 1 addition & 1 deletion types/src/v18/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
//! | importwallet | returns nothing | |
//! | keypoolrefill | returns nothing | |
//! | listaddressgroupings | version + model | UNTESTED |
//! | listlabels | version + model | UNTESTED |
//! | listlabels | version | |
//! | listlockunspent | version + model | UNTESTED |
//! | listreceivedbyaddress | version + model | UNTESTED |
//! | listreceivedbylabel | version + model | |
Expand Down
2 changes: 1 addition & 1 deletion types/src/v19/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
//! | importwallet | returns nothing | |
//! | keypoolrefill | returns nothing | |
//! | listaddressgroupings | version + model | UNTESTED |
//! | listlabels | version + model | UNTESTED |
//! | listlabels | version | |
//! | listlockunspent | version + model | UNTESTED |
//! | listreceivedbyaddress | version + model | UNTESTED |
//! | listreceivedbylabel | version + model | |
Expand Down
2 changes: 1 addition & 1 deletion types/src/v20/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
//! | importwallet | returns nothing | |
//! | keypoolrefill | returns nothing | |
//! | listaddressgroupings | version + model | UNTESTED |
//! | listlabels | version + model | UNTESTED |
//! | listlabels | version | |
//! | listlockunspent | version + model | UNTESTED |
//! | listreceivedbyaddress | version + model | UNTESTED |
//! | listreceivedbylabel | version + model | |
Expand Down
2 changes: 1 addition & 1 deletion types/src/v21/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
//! | importwallet | returns nothing | |
//! | keypoolrefill | returns nothing | |
//! | listaddressgroupings | version + model | UNTESTED |
//! | listlabels | version + model | UNTESTED |
//! | listlabels | version | |
//! | listlockunspent | version + model | UNTESTED |
//! | psbtbumpfee | version + model | |
//! | listreceivedbyaddress | version + model | UNTESTED |
Expand Down
2 changes: 1 addition & 1 deletion types/src/v22/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
//! | keypoolrefill | returns nothing | |
//! | listaddressgroupings | version + model | UNTESTED |
//! | listdescriptors | version | |
//! | listlabels | version + model | UNTESTED |
//! | listlabels | version | |
//! | listlockunspent | version + model | UNTESTED |
//! | psbtbumpfee | version + model | |
//! | listreceivedbyaddress | version + model | UNTESTED |
Expand Down
2 changes: 1 addition & 1 deletion types/src/v23/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
//! | keypoolrefill | returns nothing | |
//! | listaddressgroupings | version + model | UNTESTED |
//! | listdescriptors | version | |
//! | listlabels | version + model | UNTESTED |
//! | listlabels | version | |
//! | listlockunspent | version + model | UNTESTED |
//! | newkeypool | returns nothing | |
//! | psbtbumpfee | version + model | |
Expand Down
2 changes: 1 addition & 1 deletion types/src/v24/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
//! | keypoolrefill | returns nothing | |
//! | listaddressgroupings | version + model | UNTESTED |
//! | listdescriptors | version | |
//! | listlabels | version + model | UNTESTED |
//! | listlabels | version | |
//! | listlockunspent | version + model | UNTESTED |
//! | migratewallet | version | |
//! | newkeypool | returns nothing | |
Expand Down
2 changes: 1 addition & 1 deletion types/src/v25/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
//! | keypoolrefill | returns nothing | |
//! | listaddressgroupings | version + model | UNTESTED |
//! | listdescriptors | version | |
//! | listlabels | version + model | UNTESTED |
//! | listlabels | version | |
//! | listlockunspent | version + model | UNTESTED |
//! | migratewallet | version | |
//! | newkeypool | returns nothing | |
Expand Down
2 changes: 1 addition & 1 deletion types/src/v26/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
//! | keypoolrefill | returns nothing | |
//! | listaddressgroupings | version + model | UNTESTED |
//! | listdescriptors | version | |
//! | listlabels | version + model | UNTESTED |
//! | listlabels | version | |
//! | listlockunspent | version + model | UNTESTED |
//! | migratewallet | version | |
//! | newkeypool | returns nothing | |
Expand Down
2 changes: 1 addition & 1 deletion types/src/v27/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
//! | keypoolrefill | returns nothing | |
//! | listaddressgroupings | version + model | UNTESTED |
//! | listdescriptors | version | |
//! | listlabels | version + model | UNTESTED |
//! | listlabels | version | |
//! | listlockunspent | version + model | UNTESTED |
//! | migratewallet | version | |
//! | newkeypool | returns nothing | |
Expand Down
2 changes: 1 addition & 1 deletion types/src/v28/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
//! | keypoolrefill | returns nothing | |
//! | listaddressgroupings | version + model | UNTESTED |
//! | listdescriptors | version | |
//! | listlabels | version + model | UNTESTED |
//! | listlabels | version | |
//! | listlockunspent | version + model | UNTESTED |
//! | migratewallet | version | |
//! | newkeypool | returns nothing | |
Expand Down
2 changes: 1 addition & 1 deletion types/src/v29/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
//! | keypoolrefill | returns nothing | |
//! | listaddressgroupings | version + model | UNTESTED |
//! | listdescriptors | version | |
//! | listlabels | version + model | UNTESTED |
//! | listlabels | version | |
//! | listlockunspent | version + model | UNTESTED |
//! | migratewallet | version | |
//! | newkeypool | returns nothing | |
Expand Down
2 changes: 1 addition & 1 deletion verify/src/method/v17.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ pub const METHODS: &[Method] = &[
Method::new_nothing("keypoolrefill", "keypool_refill"),
Method::new_nothing("listaccounts", "list_accounts"), // Deprecated
Method::new_modelled("listaddressgroupings", "ListAddressGroupings", "list_address_groupings"),
Method::new_modelled("listlabels", "ListLabels", "list_labels"),
Method::new_no_model("listlabels", "ListLabels", "list_labels"),
Method::new_modelled("listlockunspent", "ListLockUnspent", "list_lock_unspent"),
Method::new_nothing("listreceivedbyaccount", "list_received_by_account"), // Deprecated
Method::new_modelled(
Expand Down
2 changes: 1 addition & 1 deletion verify/src/method/v18.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub const METHODS: &[Method] = &[
Method::new_nothing("importwallet", "import_walet"),
Method::new_nothing("keypoolrefill", "keypool_refill"),
Method::new_modelled("listaddressgroupings", "ListAddressGroupings", "list_address_groupings"),
Method::new_modelled("listlabels", "ListLabels", "list_labels"),
Method::new_no_model("listlabels", "ListLabels", "list_labels"),
Method::new_modelled("listlockunspent", "ListLockUnspent", "list_lock_unspent"),
Method::new_modelled(
"listreceivedbyaddress",
Expand Down
2 changes: 1 addition & 1 deletion verify/src/method/v19.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pub const METHODS: &[Method] = &[
Method::new_nothing("importwallet", "import_walet"),
Method::new_nothing("keypoolrefill", "keypool_refill"),
Method::new_modelled("listaddressgroupings", "ListAddressGroupings", "list_address_groupings"),
Method::new_modelled("listlabels", "ListLabels", "list_labels"),
Method::new_no_model("listlabels", "ListLabels", "list_labels"),
Method::new_modelled("listlockunspent", "ListLockUnspent", "list_lock_unspent"),
Method::new_modelled(
"listreceivedbyaddress",
Expand Down
2 changes: 1 addition & 1 deletion verify/src/method/v20.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ pub const METHODS: &[Method] = &[
Method::new_nothing("importwallet", "import_walet"),
Method::new_nothing("keypoolrefill", "keypool_refill"),
Method::new_modelled("listaddressgroupings", "ListAddressGroupings", "list_address_groupings"),
Method::new_modelled("listlabels", "ListLabels", "list_labels"),
Method::new_no_model("listlabels", "ListLabels", "list_labels"),
Method::new_modelled("listlockunspent", "ListLockUnspent", "list_lock_unspent"),
Method::new_modelled(
"listreceivedbyaddress",
Expand Down
2 changes: 1 addition & 1 deletion verify/src/method/v21.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ pub const METHODS: &[Method] = &[
Method::new_nothing("importwallet", "import_walet"),
Method::new_nothing("keypoolrefill", "keypool_refill"),
Method::new_modelled("listaddressgroupings", "ListAddressGroupings", "list_address_groupings"),
Method::new_modelled("listlabels", "ListLabels", "list_labels"),
Method::new_no_model("listlabels", "ListLabels", "list_labels"),
Method::new_modelled("listlockunspent", "ListLockUnspent", "list_lock_unspent"),
Method::new_modelled("psbtbumpfee", "PsbtBumpFee", "psbt_bump_fee"),
Method::new_modelled(
Expand Down
2 changes: 1 addition & 1 deletion verify/src/method/v22.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pub const METHODS: &[Method] = &[
Method::new_nothing("keypoolrefill", "keypool_refill"),
Method::new_modelled("listaddressgroupings", "ListAddressGroupings", "list_address_groupings"),
Method::new_no_model("listdescriptors", "ListDescriptors", "list_descriptors"),
Method::new_modelled("listlabels", "ListLabels", "list_labels"),
Method::new_no_model("listlabels", "ListLabels", "list_labels"),
Method::new_modelled("listlockunspent", "ListLockUnspent", "list_lock_unspent"),
Method::new_modelled("psbtbumpfee", "PsbtBumpFee", "psbt_bump_fee"),
Method::new_modelled(
Expand Down
2 changes: 1 addition & 1 deletion verify/src/method/v23.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ pub const METHODS: &[Method] = &[
Method::new_nothing("keypoolrefill", "keypool_refill"),
Method::new_modelled("listaddressgroupings", "ListAddressGroupings", "list_address_groupings"),
Method::new_no_model("listdescriptors", "ListDescriptors", "list_descriptors"),
Method::new_modelled("listlabels", "ListLabels", "list_labels"),
Method::new_no_model("listlabels", "ListLabels", "list_labels"),
Method::new_modelled("listlockunspent", "ListLockUnspent", "list_lock_unspent"),
Method::new_modelled("newkeypool", "NewKeyPool", "new_key_pool"),
Method::new_modelled("psbtbumpfee", "PsbtBumpFee", "psbt_bump_fee"),
Expand Down
2 changes: 1 addition & 1 deletion verify/src/method/v24.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ pub const METHODS: &[Method] = &[
Method::new_nothing("keypoolrefill", "keypool_refill"),
Method::new_modelled("listaddressgroupings", "ListAddressGroupings", "list_address_groupings"),
Method::new_no_model("listdescriptors", "ListDescriptors", "list_descriptors"),
Method::new_modelled("listlabels", "ListLabels", "list_labels"),
Method::new_no_model("listlabels", "ListLabels", "list_labels"),
Method::new_modelled("listlockunspent", "ListLockUnspent", "list_lock_unspent"),
Method::new_no_model("migratewallet", "MigrateWallet", "migrate_wallet"),
Method::new_modelled("newkeypool", "NewKeyPool", "new_key_pool"),
Expand Down
2 changes: 1 addition & 1 deletion verify/src/method/v25.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pub const METHODS: &[Method] = &[
Method::new_nothing("keypoolrefill", "keypool_refill"),
Method::new_modelled("listaddressgroupings", "ListAddressGroupings", "list_address_groupings"),
Method::new_no_model("listdescriptors", "ListDescriptors", "list_descriptors"),
Method::new_modelled("listlabels", "ListLabels", "list_labels"),
Method::new_no_model("listlabels", "ListLabels", "list_labels"),
Method::new_modelled("listlockunspent", "ListLockUnspent", "list_lock_unspent"),
Method::new_no_model("migratewallet", "MigrateWallet", "migrate_wallet"),
Method::new_modelled("newkeypool", "NewKeyPool", "new_key_pool"),
Expand Down
2 changes: 1 addition & 1 deletion verify/src/method/v26.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ pub const METHODS: &[Method] = &[
Method::new_nothing("keypoolrefill", "keypool_refill"),
Method::new_modelled("listaddressgroupings", "ListAddressGroupings", "list_address_groupings"),
Method::new_no_model("listdescriptors", "ListDescriptors", "list_descriptors"),
Method::new_modelled("listlabels", "ListLabels", "list_labels"),
Method::new_no_model("listlabels", "ListLabels", "list_labels"),
Method::new_modelled("listlockunspent", "ListLockUnspent", "list_lock_unspent"),
Method::new_no_model("migratewallet", "MigrateWallet", "migrate_wallet"),
Method::new_modelled("newkeypool", "NewKeyPool", "new_key_pool"),
Expand Down
Loading