Skip to content

feat(wallet): persist and verify discriptor hashes when loading data

Sign in for the full log view
GitHub Actions / clippy failed Dec 6, 2023 in 0s

clippy

6 errors

Details

Results

Message level Amount
Internal compiler error 0
Error 6
Warning 0
Note 0
Help 0

Versions

  • rustc 1.67.0 (fc594f156 2023-01-24)
  • cargo 1.67.0 (8ecd4f20a 2023-01-10)
  • clippy 0.1.67 (fc594f1 2023-01-24)

Annotations

Check failure on line 643 in crates/bdk/src/wallet/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `bitcoin::bitcoin_hashes::sha256::Hash` which implements the `Copy` trait

error: using `clone` on type `bitcoin::bitcoin_hashes::sha256::Hash` which implements the `Copy` trait
   --> crates/bdk/src/wallet/mod.rs:643:22
    |
643 |             .map(|v| v.clone());
    |                      ^^^^^^^^^ help: try dereferencing it: `*v`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check failure on line 643 in crates/bdk/src/wallet/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you are using an explicit closure for copying elements

error: you are using an explicit closure for copying elements
   --> crates/bdk/src/wallet/mod.rs:640:50
    |
640 |           let changeset_internal_descriptor_hash = changeset
    |  __________________________________________________^
641 | |             .descriptor_hashes
642 | |             .get(&KeychainKind::Internal)
643 | |             .map(|v| v.clone());
    | |_______________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone
    = note: `-D clippy::map-clone` implied by `-D warnings`
help: consider calling the dedicated `copied` method
    |
640 ~         let changeset_internal_descriptor_hash = changeset
641 +             .descriptor_hashes
642 ~             .get(&KeychainKind::Internal).copied();
    |

Check failure on line 627 in crates/bdk/src/wallet/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `bitcoin::bitcoin_hashes::sha256::Hash` which implements the `Copy` trait

error: using `clone` on type `bitcoin::bitcoin_hashes::sha256::Hash` which implements the `Copy` trait
   --> crates/bdk/src/wallet/mod.rs:619:50
    |
619 |           let changeset_external_descriptor_hash = changeset
    |  __________________________________________________^
620 | |             .descriptor_hashes
621 | |             .get(&KeychainKind::External)
622 | |             .ok_or(LoadError::DescriptorDoesNotMatch {
...   |
626 | |             })?
627 | |             .clone();
    | |____________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
    = note: `-D clippy::clone-on-copy` implied by `-D warnings`
help: try dereferencing it
    |
619 ~         let changeset_external_descriptor_hash = *changeset
620 +             .descriptor_hashes
621 +             .get(&KeychainKind::External)
622 +             .ok_or(LoadError::DescriptorDoesNotMatch {
623 +                 keychain: KeychainKind::External,
624 +                 expected: Some(external_descriptor_hash),
625 +                 got: None,
626 ~             })?;
    |

Check failure on line 643 in crates/bdk/src/wallet/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `bitcoin::bitcoin_hashes::sha256::Hash` which implements the `Copy` trait

error: using `clone` on type `bitcoin::bitcoin_hashes::sha256::Hash` which implements the `Copy` trait
   --> crates/bdk/src/wallet/mod.rs:643:22
    |
643 |             .map(|v| v.clone());
    |                      ^^^^^^^^^ help: try dereferencing it: `*v`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check failure on line 643 in crates/bdk/src/wallet/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you are using an explicit closure for copying elements

error: you are using an explicit closure for copying elements
   --> crates/bdk/src/wallet/mod.rs:640:50
    |
640 |           let changeset_internal_descriptor_hash = changeset
    |  __________________________________________________^
641 | |             .descriptor_hashes
642 | |             .get(&KeychainKind::Internal)
643 | |             .map(|v| v.clone());
    | |_______________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone
    = note: `-D clippy::map-clone` implied by `-D warnings`
help: consider calling the dedicated `copied` method
    |
640 ~         let changeset_internal_descriptor_hash = changeset
641 +             .descriptor_hashes
642 ~             .get(&KeychainKind::Internal).copied();
    |

Check failure on line 627 in crates/bdk/src/wallet/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `bitcoin::bitcoin_hashes::sha256::Hash` which implements the `Copy` trait

error: using `clone` on type `bitcoin::bitcoin_hashes::sha256::Hash` which implements the `Copy` trait
   --> crates/bdk/src/wallet/mod.rs:619:50
    |
619 |           let changeset_external_descriptor_hash = changeset
    |  __________________________________________________^
620 | |             .descriptor_hashes
621 | |             .get(&KeychainKind::External)
622 | |             .ok_or(LoadError::DescriptorDoesNotMatch {
...   |
626 | |             })?
627 | |             .clone();
    | |____________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
    = note: `-D clippy::clone-on-copy` implied by `-D warnings`
help: try dereferencing it
    |
619 ~         let changeset_external_descriptor_hash = *changeset
620 +             .descriptor_hashes
621 +             .get(&KeychainKind::External)
622 +             .ok_or(LoadError::DescriptorDoesNotMatch {
623 +                 keychain: KeychainKind::External,
624 +                 expected: Some(external_descriptor_hash),
625 +                 got: None,
626 ~             })?;
    |