Skip to content

Conversation

@moisesPompilio
Copy link
Contributor

What is the purpose of this pull request?

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

Which crates are being modified?

  • floresta-chain
  • floresta-common
  • floresta-compact-filters
  • floresta-electrum
  • floresta-node
  • floresta-rpc
  • floresta-watch-only
  • floresta-wire
  • bin/florestad
  • bin/floresta-cli
  • Other:

Description and Notes

Updated the get_tx_out method to return a structured GetTxOut type instead of a raw Value.
Previously, the method returned an untyped JSON value, which made it less practical to use and required manual inspection of the response. Now, it directly returns a parsed GetTxOut object, making the response fields easier to access and work with.
If the RPC response is null, the method now returns a TxOutNotFound error to clearly indicate that the transaction output was not found.

How to verify the changes you have done?

Use the floresta-rpc library and call the get_tx_out method against a running Floresta node.

  • When the transaction output exists, it should return a structured GetTxOut object with accessible fields.
  • When it does not exist, it should return a TxOutNotFound error.

@Davidson-Souza Davidson-Souza added chore Cleaning, refactoring, reducing complexity RPC Changes something with our JSON-RPC interface labels Oct 22, 2025
@jaoleal
Copy link
Collaborator

jaoleal commented Oct 22, 2025

Weve been postergating to use corepc-types and i think this might be a good oportunitty to start its integration.

WYT @Davidson-Souza ?

@Davidson-Souza
Copy link
Member

Davidson-Souza commented Oct 22, 2025

Weve been postergating to use corepc-types and i think this might be a good oportunitty to start its integration.

WYT @Davidson-Souza ?

Sure. If @moisesPompilio wants to take a hit out of it

@moisesPompilio
Copy link
Contributor Author

Sure. If @moisesPompilio wants to take a hit out of it

Yes, I can do that. I just have a few questions. I saw issue #673, and I’d like to clarify the intent behind this change. Do you want all RPC-related types in bothfloresta-nodeand floresta-rpc to use this library, or should it be limited to floresta-rpc only?

@jaoleal
Copy link
Collaborator

jaoleal commented Oct 23, 2025

We need to move json-rpc that lives under floresta-node to floresta-rpc. Ill push it.

@Davidson-Souza
Copy link
Member

We need to move json-rpc that lives under floresta-node to floresta-rpc. Ill push it.

I don't think so. json-rpc is the server. floresta-rpc is the client. I don't think they belong together.

@jaoleal
Copy link
Collaborator

jaoleal commented Oct 24, 2025

We need to move json-rpc that lives under floresta-node to floresta-rpc. Ill push it.

I don't think so. json-rpc is the server. floresta-rpc is the client. I don't think they belong together.

Hmmmm, i moved the types into floresta-rpc. This will help a lot with type drifting, that i hate... Also, will be easy to keep track of which types we made into corepc-types.

you might want to take a look #694

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Cleaning, refactoring, reducing complexity RPC Changes something with our JSON-RPC interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants