Skip to content

Conversation

@JoseSK999
Copy link
Contributor

Description

Since BitcoinNodeHash implements From<bitcoin_hashes::sha256::Hash>, we can directly apply Into::into. Then for str conversions we can use parse instead, and map the arrays directly.

Finally in chain_state.rs and partial_chain.rs I simplify BlockchainError::BlockValidation conversions with ?.

What is the purpose of this pull request?

  • Bug fix
  • Documentation update
  • New feature
  • Test
  • Other: Simplification

Which crates are being modified?

  • floresta-chain
  • floresta-cli
  • floresta-common
  • floresta-compact-filters
  • floresta-electrum
  • floresta-watch-only
  • floresta-wire
  • floresta
  • florestad
  • Other: .

Since `BitcoinNodeHash` implements `From<bitcoin_hashes::sha256::Hash>`, we can directly apply `Into::into`. Then for str conversions we can use `parse` instead, and map the arrays directly.

Finally in `chain_state.rs` and `partial_chain.rs` I simplify `BlockchainError::BlockValidation` conversions with `?`.
@Davidson-Souza
Copy link
Member

ACK 70b0216

@Davidson-Souza Davidson-Souza merged commit 3b0a243 into vinteumorg:master Mar 5, 2025
8 checks passed
@JoseSK999 JoseSK999 deleted the simplify-nodehash-conversion branch March 5, 2025 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants