Skip to content
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

Fix #378: Add blockhash parameter into gettxproof command #379

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

TheMhv
Copy link

@TheMhv TheMhv commented Feb 18, 2025

What is the purpose of this pull request?

Fix the issue #378

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

Which crates are being modified?

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

Description

Add missing block_hash parameter into get_tx_proof function and check if transaction is included in the block.

@Davidson-Souza Davidson-Souza added the bug Something isn't working label Feb 18, 2025
@Davidson-Souza Davidson-Souza added this to the v0.8.0 milestone Feb 18, 2025
Copy link
Collaborator

@Davidson-Souza Davidson-Souza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this, I have some comments thought.

Tip: the fixes thing only works with the syntax fixes #XXX, the way you made it GH won't link the issue

) -> Result<Vec<String>, RpcError> {
if let Some(hash) = block_hash {
let block = self.get_block(hash).await?;
return Ok(vec![block
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This returns the transaction, not the merkle proof for it as this method should

@@ -297,8 +297,15 @@ async fn handle_json_rpc_request(req: Value, state: Arc<RpcImpl>) -> Result<serd
"gettxoutproof" => {
let txid = Txid::from_str(params[0].as_str().ok_or(Error::InvalidHash)?)
.map_err(|_| Error::InvalidHash)?;
let blockhash = match params[1].as_str() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is easier to try parse and return error if it fails, like we do with txid

@TheMhv TheMhv changed the title Fix: Add blockhash parameter into gettxproof command Fix #378: Add blockhash parameter into gettxproof command Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants