Skip to content

Commit c25dc0c

Browse files
committed
Merge #140: bump stable rustc version to 1.65
e103664 Derive Eq on enums and struts where possible (rajarshimaitra) 0f3aca2 bump stable rustc version to 1.65 (rajarshimaitra) Pull request description: <!-- You can erase any parts of this template not applicable to your Pull Request. --> ### Description As BDK bumped its stable to 1.65, it is safe for us to move it up also. ### Notes to the reviewers `1.65` cause clippy warning that `Eq` isn't derived while `PartialEq` is derived for the commands. We can't derive `Eq` for commands, as there is a `fee_rate` which is `f32` which isn't `Eq`, and this effect cascades to all structures. We also need `PartialEq` for the tests. A few options were: - allow the clippy warning conditionally for `1.65`, `1.57` doesn't have that lint. The way to do that is by creating custom features for different versions and making a build script that activates specific features for specific versions. Feature gate the clippy lint. or use https://github.com/dtolnay/rustversion which is an extra dep. - Remove `PartialEq` and create a method on `CliOpts` to translate it into `Vec<String>`, and then perform the tests. - Make `fee_rate` `u32` and derive `Eq` for all. I went for the last option as it seemed less complex, and not too bad(?). For bdk_cli as majorly a testing tool, it might not need floating point granularity and users can still test out with `u32` fee_rates. Internally it converts it back to `f32`. Suggestions welcome. ## Changelog notice - Bumped rustc `stable` to 1.65. ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk-cli/blob/master/CONTRIBUTING.md) * [x] I ran `cargo fmt` and `cargo clippy` before committing Top commit has no ACKs. Tree-SHA512: d471d56dc6e50cc892a889bbe1f0283ce22feb9c34b6bdebfcfb71117069df166086d1e00c9a8e22979d2be24fad797335066d6c6a58a8ca5ec5f1d2b8d9575e
2 parents 5c2a97e + e103664 commit c25dc0c

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

.github/workflows/cont_integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
matrix:
1212
rust:
13-
- 1.60.0 # STABLE
13+
- 1.65.0 # STABLE
1414
- 1.57.0 # MSRV
1515
features:
1616
- default

src/commands.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ pub enum CliSubCommand {
144144
}
145145

146146
/// Backend Node operation subcommands.
147-
#[derive(Debug, Subcommand, Clone, PartialEq)]
147+
#[derive(Debug, Subcommand, Clone, PartialEq, Eq)]
148148
#[clap(rename_all = "lower")]
149149
#[cfg(any(feature = "regtest-node"))]
150150
pub enum NodeSubCommand {
@@ -179,7 +179,7 @@ pub enum WalletSubCommand {
179179
}
180180

181181
/// Config options wallet operations can take.
182-
#[derive(Debug, Parser, Clone, PartialEq)]
182+
#[derive(Debug, Parser, Clone, PartialEq, Eq)]
183183
pub struct WalletOpts {
184184
/// Selects the wallet to use.
185185
#[clap(name = "WALLET_NAME", short = 'w', long = "wallet")]
@@ -212,7 +212,7 @@ pub struct WalletOpts {
212212

213213
/// Options to configure a SOCKS5 proxy for a blockchain client connection.
214214
#[cfg(any(feature = "compact_filters", feature = "electrum", feature = "esplora"))]
215-
#[derive(Debug, Args, Clone, PartialEq)]
215+
#[derive(Debug, Args, Clone, PartialEq, Eq)]
216216
pub struct ProxyOpts {
217217
/// Sets the SOCKS5 proxy for a blockchain client.
218218
#[clap(name = "PROXY_ADDRS:PORT", long = "proxy", short = 'p')]
@@ -234,7 +234,7 @@ pub struct ProxyOpts {
234234

235235
/// Options to configure a BIP157 Compact Filter backend.
236236
#[cfg(feature = "compact_filters")]
237-
#[derive(Debug, Args, Clone, PartialEq)]
237+
#[derive(Debug, Args, Clone, PartialEq, Eq)]
238238
pub struct CompactFilterOpts {
239239
/// Sets the full node network address.
240240
#[clap(
@@ -261,7 +261,7 @@ pub struct CompactFilterOpts {
261261

262262
/// Options to configure a bitcoin core rpc backend.
263263
#[cfg(feature = "rpc")]
264-
#[derive(Debug, Args, Clone, PartialEq)]
264+
#[derive(Debug, Args, Clone, PartialEq, Eq)]
265265
pub struct RpcOpts {
266266
/// Sets the full node address for rpc connection.
267267
#[clap(
@@ -298,7 +298,7 @@ pub struct RpcOpts {
298298

299299
/// Options to configure electrum backend.
300300
#[cfg(feature = "electrum")]
301-
#[derive(Debug, Args, Clone, PartialEq)]
301+
#[derive(Debug, Args, Clone, PartialEq, Eq)]
302302
pub struct ElectrumOpts {
303303
/// Sets the SOCKS5 proxy timeout for the Electrum client.
304304
#[clap(name = "PROXY_TIMEOUT", short = 't', long = "timeout")]
@@ -324,7 +324,7 @@ pub struct ElectrumOpts {
324324

325325
/// Options to configure Esplora backend.
326326
#[cfg(feature = "esplora")]
327-
#[derive(Debug, Args, Clone, PartialEq)]
327+
#[derive(Debug, Args, Clone, PartialEq, Eq)]
328328
pub struct EsploraOpts {
329329
/// Use the esplora server if given as parameter.
330330
#[clap(
@@ -477,7 +477,7 @@ pub enum OfflineWalletSubCommand {
477477
}
478478

479479
/// Wallet subcommands that needs a blockchain backend.
480-
#[derive(Debug, Subcommand, Clone, PartialEq)]
480+
#[derive(Debug, Subcommand, Clone, PartialEq, Eq)]
481481
#[clap(rename_all = "snake")]
482482
#[cfg(any(
483483
feature = "electrum",
@@ -530,7 +530,7 @@ pub enum OnlineWalletSubCommand {
530530
}
531531

532532
/// Subcommands for Key operations.
533-
#[derive(Debug, Subcommand, Clone, PartialEq)]
533+
#[derive(Debug, Subcommand, Clone, PartialEq, Eq)]
534534
pub enum KeySubCommand {
535535
/// Generates new random seed mnemonic phrase and corresponding master extended key.
536536
Generate {

src/handlers.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -747,18 +747,18 @@ pub(crate) fn handle_command(cli_opts: CliOpts) -> Result<String, Error> {
747747
result.map_err(|e| e.into())
748748
}
749749

750+
#[cfg(any(
751+
feature = "electrum",
752+
feature = "esplora",
753+
feature = "compact_filters",
754+
feature = "rpc"
755+
))]
750756
#[cfg(test)]
751757
mod test {
752758
use super::*;
753759
use bdk::bitcoin::psbt::PartiallySignedTransaction;
754760
use std::str::FromStr;
755761

756-
#[cfg(any(
757-
feature = "electrum",
758-
feature = "esplora",
759-
feature = "compact_filters",
760-
feature = "rpc"
761-
))]
762762
#[test]
763763
fn test_psbt_is_final() {
764764
let unsigned_psbt = PartiallySignedTransaction::from_str("cHNidP8BAIkBAAAAASWJHzxzyVORV/C3lAynKHVVL7+Rw7/Jj8U9fuvD24olAAAAAAD+////AiBOAAAAAAAAIgAgLzY9yE4jzTFJnHtTjkc+rFAtJ9NB7ENFQ1xLYoKsI1cfqgKVAAAAACIAIFsbWgDeLGU8EA+RGwBDIbcv4gaGG0tbEIhDvwXXa/E7LwEAAAABALUCAAAAAAEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////BALLAAD/////AgD5ApUAAAAAIgAgWxtaAN4sZTwQD5EbAEMhty/iBoYbS1sQiEO/Bddr8TsAAAAAAAAAACZqJKohqe3i9hw/cdHe/T+pmd+jaVN1XGkGiXmZYrSL69g2l06M+QEgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQErAPkClQAAAAAiACBbG1oA3ixlPBAPkRsAQyG3L+IGhhtLWxCIQ78F12vxOwEFR1IhA/JV2U/0pXW+iP49QcsYilEvkZEd4phmDM8nV8wC+MeDIQLKhV/gEZYmlsQXnsL5/Uqv5Y8O31tmWW1LQqIBkiqzCVKuIgYCyoVf4BGWJpbEF57C+f1Kr+WPDt9bZlltS0KiAZIqswkEboH3lCIGA/JV2U/0pXW+iP49QcsYilEvkZEd4phmDM8nV8wC+MeDBDS6ZSEAACICAsqFX+ARliaWxBeewvn9Sq/ljw7fW2ZZbUtCogGSKrMJBG6B95QiAgPyVdlP9KV1voj+PUHLGIpRL5GRHeKYZgzPJ1fMAvjHgwQ0umUhAA==").unwrap();

0 commit comments

Comments
 (0)