Skip to content

Commit cc15214

Browse files
authored
Merge pull request #141 from tcharding/04-30-dump-wallet
Remove model for dumpwallet
2 parents f515d26 + 7175022 commit cc15214

File tree

16 files changed

+16
-29
lines changed

16 files changed

+16
-29
lines changed

integration_test/tests/wallet.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ fn wallet__dump_priv_key__modelled() {
9595
}
9696

9797
#[test]
98-
fn wallet__dump_wallet__modelled() {
98+
fn wallet__dump_wallet() {
9999
// As of Core v23 the default wallet is an native descriptor wallet which does not
100100
// support dumping private keys. Legacy wallets are supported upto v25 it seems.
101101
#[cfg(any(
@@ -109,8 +109,7 @@ fn wallet__dump_wallet__modelled() {
109109
node.client.create_legacy_wallet("legacy_wallet").expect("legacy create_wallet");
110110
let out = integration_test::random_tmp_file();
111111

112-
let json: DumpWallet = node.client.dump_wallet(&out).expect("dumpwallet");
113-
let _: mtype::DumpWallet = json.into_model();
112+
let _: DumpWallet = node.client.dump_wallet(&out).expect("dumpwallet");
114113
}
115114

116115
#[cfg(any(
@@ -125,8 +124,7 @@ fn wallet__dump_wallet__modelled() {
125124
let node = Node::with_wallet(Wallet::Default, &[]);
126125
let out = integration_test::random_tmp_file();
127126

128-
let json: DumpWallet = node.client.dump_wallet(&out).expect("dumpwallet");
129-
let _: mtype::DumpWallet = json.into_model();
127+
let _: DumpWallet = node.client.dump_wallet(&out).expect("dumpwallet");
130128
}
131129
}
132130

types/src/model/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub use self::{
4545
},
4646
wallet::{
4747
AddMultisigAddress, AddressInformation, AddressLabel, AddressPurpose, Bip125Replaceable,
48-
BumpFee, CreateWallet, DumpPrivKey, DumpWallet, GetAddressInfo, GetAddressInfoEmbedded,
48+
BumpFee, CreateWallet, DumpPrivKey, GetAddressInfo, GetAddressInfoEmbedded,
4949
GetAddressesByLabel, GetBalance, GetBalances, GetBalancesMine, GetBalancesWatchOnly,
5050
GetNewAddress, GetRawChangeAddress, GetReceivedByAddress, GetTransaction,
5151
GetTransactionDetail, GetUnconfirmedBalance, GetWalletInfo, ListAddressGroupings,

types/src/model/wallet.rs

-6
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,6 @@ pub struct CreateWallet {
8787
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
8888
pub struct DumpPrivKey(pub PrivateKey);
8989

90-
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
91-
pub struct DumpWallet {
92-
/// The filename with full absolute path.
93-
pub file_name: String, // FIXME: Should this be `PathBuf`?
94-
}
95-
9690
/// Models the result of JSON-RPC method `getaddressesbylabel`.
9791
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
9892
pub struct GetAddressesByLabel(pub BTreeMap<Address<NetworkUnchecked>, AddressInformation>);

types/src/v17/wallet/into.rs

-5
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,6 @@ impl DumpPrivKey {
9898
}
9999
}
100100

101-
impl DumpWallet {
102-
/// Converts version specific type to a version nonspecific, more strongly typed type.
103-
pub fn into_model(self) -> model::DumpWallet { model::DumpWallet { file_name: self.file_name } }
104-
}
105-
106101
impl AddressInformation {
107102
/// Converts version specific type to a version nonspecific, more strongly typed type.
108103
pub fn into_model(self) -> model::AddressInformation {

verify/src/method/v17.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub const METHODS: &[Method] = &[
9393
Method::new_modelled("bumpfee", "BumpFee", "bump_fee"),
9494
Method::new_modelled("createwallet", "CreateWallet", "create_wallet"),
9595
Method::new_modelled("dumpprivkey", "DumpPrivKey", "dump_priv_key"),
96-
Method::new_modelled("dumpwallet", "DumpWallet", "dump_wallet"),
96+
Method::new_no_model("dumpwallet", "DumpWallet", "dump_wallet"),
9797
Method::new_nothing("encryptwallet", "encrypt_wallet"),
9898
Method::new_nothing("getaccount", "get_account"), // Deprecated
9999
Method::new_nothing("getaccountaddress", "get_account_address"), // Deprecated

verify/src/method/v18.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ pub const METHODS: &[Method] = &[
100100
Method::new_modelled("bumpfee", "BumpFee", "bump_fee"),
101101
Method::new_modelled("createwallet", "CreateWallet", "create_wallet"),
102102
Method::new_modelled("dumpprivkey", "DumpPrivKey", "dump_priv_key"),
103-
Method::new_modelled("dumpwallet", "DumpWallet", "dump_wallet"),
103+
Method::new_no_model("dumpwallet", "DumpWallet", "dump_wallet"),
104104
Method::new_nothing("encryptwallet", "encrypt_wallet"),
105105
Method::new_modelled("getaddressesbylabel", "GetAddressesByLabel", "get_addresses_by_label"),
106106
Method::new_modelled("getaddressinfo", "GetAddressInfo", "get_address_info"),

verify/src/method/v19.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ pub const METHODS: &[Method] = &[
9292
Method::new_modelled("bumpfee", "BumpFee", "bump_fee"),
9393
Method::new_modelled("createwallet", "CreateWallet", "create_wallet"),
9494
Method::new_modelled("dumpprivkey", "DumpPrivKey", "dump_priv_key"),
95-
Method::new_modelled("dumpwallet", "DumpWallet", "dump_wallet"),
95+
Method::new_no_model("dumpwallet", "DumpWallet", "dump_wallet"),
9696
Method::new_nothing("encryptwallet", "encrypt_wallet"),
9797
Method::new_modelled("getaddressesbylabel", "GetAddressesByLabel", "get_addresses_by_label"),
9898
Method::new_modelled("getaddressinfo", "GetAddressInfo", "get_address_info"),

verify/src/method/v20.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub const METHODS: &[Method] = &[
9393
Method::new_modelled("bumpfee", "BumpFee", "bump_fee"),
9494
Method::new_modelled("createwallet", "CreateWallet", "create_wallet"),
9595
Method::new_modelled("dumpprivkey", "DumpPrivKey", "dump_priv_key"),
96-
Method::new_modelled("dumpwallet", "DumpWallet", "dump_wallet"),
96+
Method::new_no_model("dumpwallet", "DumpWallet", "dump_wallet"),
9797
Method::new_nothing("encryptwallet", "encrypt_wallet"),
9898
Method::new_modelled("getaddressesbylabel", "GetAddressesByLabel", "get_addresses_by_label"),
9999
Method::new_modelled("getaddressinfo", "GetAddressInfo", "get_address_info"),

verify/src/method/v21.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ pub const METHODS: &[Method] = &[
9595
Method::new_modelled("bumpfee", "BumpFee", "bump_fee"),
9696
Method::new_modelled("createwallet", "CreateWallet", "create_wallet"),
9797
Method::new_modelled("dumpprivkey", "DumpPrivKey", "dump_priv_key"),
98-
Method::new_modelled("dumpwallet", "DumpWallet", "dump_wallet"),
98+
Method::new_no_model("dumpwallet", "DumpWallet", "dump_wallet"),
9999
Method::new_nothing("encryptwallet", "encrypt_wallet"),
100100
Method::new_modelled("getaddressesbylabel", "GetAddressesByLabel", "get_addresses_by_label"),
101101
Method::new_modelled("getaddressinfo", "GetAddressInfo", "get_address_info"),

verify/src/method/v22.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ pub const METHODS: &[Method] = &[
9696
Method::new_modelled("bumpfee", "BumpFee", "bump_fee"),
9797
Method::new_modelled("createwallet", "CreateWallet", "create_wallet"),
9898
Method::new_modelled("dumpprivkey", "DumpPrivKey", "dump_priv_key"),
99-
Method::new_modelled("dumpwallet", "DumpWallet", "dump_wallet"),
99+
Method::new_no_model("dumpwallet", "DumpWallet", "dump_wallet"),
100100
Method::new_nothing("encryptwallet", "encrypt_wallet"),
101101
Method::new_modelled("getaddressesbylabel", "GetAddressesByLabel", "get_addresses_by_label"),
102102
Method::new_modelled("getaddressinfo", "GetAddressInfo", "get_address_info"),

verify/src/method/v23.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ pub const METHODS: &[Method] = &[
9595
Method::new_modelled("bumpfee", "BumpFee", "bump_fee"),
9696
Method::new_modelled("createwallet", "CreateWallet", "create_wallet"),
9797
Method::new_modelled("dumpprivkey", "DumpPrivKey", "dump_priv_key"),
98-
Method::new_modelled("dumpwallet", "DumpWallet", "dump_wallet"),
98+
Method::new_no_model("dumpwallet", "DumpWallet", "dump_wallet"),
9999
Method::new_nothing("encryptwallet", "encrypt_wallet"),
100100
Method::new_modelled("getaddressesbylabel", "GetAddressesByLabel", "get_addresses_by_label"),
101101
Method::new_modelled("getaddressinfo", "GetAddressInfo", "get_address_info"),

verify/src/method/v24.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ pub const METHODS: &[Method] = &[
9696
Method::new_modelled("bumpfee", "BumpFee", "bump_fee"),
9797
Method::new_modelled("createwallet", "CreateWallet", "create_wallet"),
9898
Method::new_modelled("dumpprivkey", "DumpPrivKey", "dump_priv_key"),
99-
Method::new_modelled("dumpwallet", "DumpWallet", "dump_wallet"),
99+
Method::new_no_model("dumpwallet", "DumpWallet", "dump_wallet"),
100100
Method::new_nothing("encryptwallet", "encrypt_wallet"),
101101
Method::new_modelled("getaddressesbylabel", "GetAddressesByLabel", "get_addresses_by_label"),
102102
Method::new_modelled("getaddressinfo", "GetAddressInfo", "get_address_info"),

verify/src/method/v25.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pub const METHODS: &[Method] = &[
9797
Method::new_modelled("bumpfee", "BumpFee", "bump_fee"),
9898
Method::new_modelled("createwallet", "CreateWallet", "create_wallet"),
9999
Method::new_modelled("dumpprivkey", "DumpPrivKey", "dump_priv_key"),
100-
Method::new_modelled("dumpwallet", "DumpWallet", "dump_wallet"),
100+
Method::new_no_model("dumpwallet", "DumpWallet", "dump_wallet"),
101101
Method::new_nothing("encryptwallet", "encrypt_wallet"),
102102
Method::new_modelled("getaddressesbylabel", "GetAddressesByLabel", "get_addresses_by_label"),
103103
Method::new_modelled("getaddressinfo", "GetAddressInfo", "get_address_info"),

verify/src/method/v26.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ pub const METHODS: &[Method] = &[
105105
Method::new_modelled("bumpfee", "BumpFee", "bump_fee"),
106106
Method::new_modelled("createwallet", "CreateWallet", "create_wallet"),
107107
Method::new_modelled("dumpprivkey", "DumpPrivKey", "dump_priv_key"),
108-
Method::new_modelled("dumpwallet", "DumpWallet", "dump_wallet"),
108+
Method::new_no_model("dumpwallet", "DumpWallet", "dump_wallet"),
109109
Method::new_nothing("encryptwallet", "encrypt_wallet"),
110110
Method::new_modelled("getaddressesbylabel", "GetAddressesByLabel", "get_addresses_by_label"),
111111
Method::new_modelled("getaddressinfo", "GetAddressInfo", "get_address_info"),

verify/src/method/v27.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ pub const METHODS: &[Method] = &[
107107
Method::new_modelled("bumpfee", "BumpFee", "bump_fee"),
108108
Method::new_modelled("createwallet", "CreateWallet", "create_wallet"),
109109
Method::new_modelled("dumpprivkey", "DumpPrivKey", "dump_priv_key"),
110-
Method::new_modelled("dumpwallet", "DumpWallet", "dump_wallet"),
110+
Method::new_no_model("dumpwallet", "DumpWallet", "dump_wallet"),
111111
Method::new_nothing("encryptwallet", "encrypt_wallet"),
112112
Method::new_modelled("getaddressesbylabel", "GetAddressesByLabel", "get_addresses_by_label"),
113113
Method::new_modelled("getaddressinfo", "GetAddressInfo", "get_address_info"),

verify/src/method/v28.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ pub const METHODS: &[Method] = &[
108108
Method::new_modelled("createwallet", "CreateWallet", "create_wallet"),
109109
Method::new_no_model("createwalletdescriptor", "CreateWalletDescriptor", "create_wallet_descriptor"),
110110
Method::new_modelled("dumpprivkey", "DumpPrivKey", "dump_priv_key"),
111-
Method::new_modelled("dumpwallet", "DumpWallet", "dump_wallet"),
111+
Method::new_no_model("dumpwallet", "DumpWallet", "dump_wallet"),
112112
Method::new_nothing("encryptwallet", "encrypt_wallet"),
113113
Method::new_modelled("getaddressesbylabel", "GetAddressesByLabel", "get_addresses_by_label"),
114114
Method::new_modelled("getaddressinfo", "GetAddressInfo", "get_address_info"),

0 commit comments

Comments
 (0)