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

Chainstate special RPC types #1161

Merged
merged 3 commits into from
Aug 10, 2023
Merged

Conversation

TheQuantumPhysicist
Copy link
Collaborator

These types are used to add more information to the output of json RPC instead of just serializing the raw data from that type.

Copy link
Contributor

@iljakuklic iljakuklic left a comment

Choose a reason for hiding this comment

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

Good stuff

Comment on lines +22 to +24
pub struct RpcSignedTransaction {
id: Id<Transaction>,
tx: SignedTransaction,
Copy link
Contributor

Choose a reason for hiding this comment

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

Should both transaction Id and the serialized hash (including witness) be included?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is just a start... we can add more later when we need them.

Comment on lines +30 to +34
pub fn new(block: Block, block_index: BlockIndex) -> Self {
Self {
id: block.get_id(),
height: block_index.block_height(),
block,
Copy link
Contributor

Choose a reason for hiding this comment

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

Thereare some other fields in BlockIndex that we may consider including, namely chain_trust and status.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed, but again, we can do that later. I just did this as a proof of concept so that people don't become too inventive to solve this problem :D

chainstate/src/rpc/mod.rs Show resolved Hide resolved
@@ -0,0 +1,37 @@
// Copyright (c) 2022 RBB S.r.l
Copy link
Contributor

Choose a reason for hiding this comment

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

Come and join us in the future my man

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nah... I like it here better. Now leave me alone 😄

@TheQuantumPhysicist TheQuantumPhysicist merged commit fceb53d into master Aug 10, 2023
23 checks passed
@TheQuantumPhysicist TheQuantumPhysicist deleted the feat/chainstate_rpc_types branch August 10, 2023 18:23
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.

None yet

4 participants