-
Notifications
You must be signed in to change notification settings - Fork 84
chore(rpcserver): Match signature of getblock to its rpc #788
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
chore(rpcserver): Match signature of getblock to its rpc #788
Conversation
|
Marking as draft since it depends on #682 |
4467f93 to
0f0dd5f
Compare
|
Marking as ready to review |
Davidson-Souza
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What 781efaf achieves that tests/floresta-cli/getblock.py don't?
|
|
||
| use crate::rpc_types::GetBlockRes; | ||
|
|
||
| pub fn getblock_data(verbose: bool) -> GetBlockRes { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verbose is not a bool but a numeric type, I think we need to fix this here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a internal helper to return the data, It does not need to be fallible yet neither needs to be api compatible. The bool can express both verbosity we support rn
crates/floresta-rpc/src/lib.rs
Outdated
| use crate::test_data::getblock_data; | ||
|
|
||
| struct Florestad { | ||
| pub struct Florestad { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason to make this public?
0f0dd5f to
17161d2
Compare
|
Applied suggestions on 17161d2 |
Its easy to run |
|
Really ? Honestly i see value in this, the idea is not to compete or to replace the python tests, as you said and I briefly tried to imply is that the python tests indeed deliver more assertion value but in the cost of having a lot more dependencies, including the environment setup needed. The value i see in this lives in the case where we want to assert that we are not breaking any field and any other test, the older getblock test was doing this and my plan was just to expand it make a direct comparison with a bitcoin core output. Im the "vitcim" of one of these cases, the Even with this i cant run the test, i had the idea to include this and to move it to be a functional test in the server without instantiating a florestad, we can make something similar as done here in extensions.rs... As you said, theres no reason to have two modules doing the same thing and we are investing a lot of time to make the python tests better, and i see these tests in floresta-rpc and indeed trying to compete against our python tests, specially because is a integration test between client and server. If youre willing to accept #787 we wont need to check if we are parsing the arguments correctly because im literally just getting the args from |
That could as well be in the PR description. I did not understand what you were doing here because it just says
so does |
Im well aware of that, Im really focusing on being clear following your suggestion. Sincerely, I was frustrated to be spending more time writing and reviewing my writing than actually coding and contributing, as the time goes im improving that to be more efficient. Thanks for the patience.
Well, I might change that, we can hardcode these same values directly in types(maybe implementing default ?), I used the raw json because its literally a copy-paste from what i got from bitcoin core... regarding having simple and lightweight functional tests server side, are there any cons ? Also, I want to bring up the point that we are doing a lightweight node with the objective to run on constrained devices, I think its important to have tests that people can actually run without much trouble, and that, |
17161d2 to
6a7bcd4
Compare
|
Okay, dropped the commit that was actually extending the tests. Ill present the same changes with different approach later |
Are you planning to do this on this PR or another one? If you want to do it here, please mark it as draft For new approach, I recommend just following the same approach taken by other tests in this file. |
|
Yes, another PR |
Im not sure if i got this correctly. What you mean by "the same approach" ? |
6a7bcd4 to
1aa4c6a
Compare
1aa4c6a to
d36a64d
Compare
Davidson-Souza
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK d36a64d
d36a64d to
b37772d
Compare
|
ACK b37772d |
Davidson-Souza
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK b37772d
|
@jaoleal can you update the PR description, please? |
|
Changed the pr description but im still unable to alter the name of the PR. Maybe |
Description and Notes
#682 introduced changes that brought getblock rpc method closer to bitcoin core behavior. The changes presented here make the internal method signature to match the specification.