Skip to content

Add '()' annotation and error handling to submit_header #260

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GideonBature
Copy link
Contributor

@GideonBature GideonBature commented Jun 20, 2025

This is a patch for PR #259 that adds a let _: () = ... annotation and an .expect("submitheader") call to the integration test for submit_header.

The .expect() call is necessary to extract the () value from the result returned by submit_header, making the test both explicit and consistent with the other null-returning client function tests.

Also, Introduced a for loop to increment the header’s nonce until the PoW is valid. This ensures the header meets Bitcoin’s difficulty target before calling submit_header.

@GideonBature GideonBature marked this pull request as draft June 20, 2025 06:47
Copy link
Collaborator

@jamillambert jamillambert left a comment

Choose a reason for hiding this comment

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

The test needs a mining section like the one above to find a valid nonce, otherwise the test will randomly fail with "high-hash".

@GideonBature
Copy link
Contributor Author

The test needs a mining section like the one above to find a valid nonce, otherwise the test will randomly fail with "high-hash".

Yes, I got that... Thank you.

@GideonBature GideonBature marked this pull request as ready for review June 20, 2025 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants