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

multi: add endpoints for best mainchain and sidechain hashes #42

Merged
merged 4 commits into from
Feb 27, 2025

Conversation

torkelrogstad
Copy link
Contributor

Currently the output when fetching sidechain hashes is not really on a readable format...

$ just cli get-best-sidechain-block-hash
[
  39,
  255,
  216,
  80,
  162,
  249,
  82,
  30,
  15,
  86,
  54,
  20,
  86,
  245,
  161,
  6,
  145,
  32,
  236,
  87,
  148,
  19,
  121,
  196,
  131,
  250,
  108,
  101,
  252,
  219,
  112,
  152
]

async fn get_best_sidechain_block_hash(
&self,
) -> RpcResult<Option<thunder::types::BlockHash>> {
let Some(sidechain_hash) =
Copy link
Collaborator

Choose a reason for hiding this comment

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

This could be

self.app.node.try_get_tip().map_err(custom_err)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

haha yes indeed, don't know how that ended up in there

rpc-api/lib.rs Outdated

/// Get the best sidechain block hash known by Thunder
#[open_api_method(output_schema(
PartialSchema = "thunder_schema::BitcoinBlockHash"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks like the wrong schema - is it even necessary to specify the output schema here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thx, updated the schema. I don't understand what's going on here at all to be honest.

@Ash-L2L Ash-L2L force-pushed the 2025-02-26-best-hash branch from 0cfa05a to 13df2e2 Compare February 27, 2025 14:14
@torkelrogstad torkelrogstad merged commit 58fe8ba into master Feb 27, 2025
7 checks passed
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