-
Notifications
You must be signed in to change notification settings - Fork 919
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
feat(cmd): use rpc client instead of http.Request
#2521
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2521 +/- ##
==========================================
- Coverage 52.64% 51.71% -0.94%
==========================================
Files 156 157 +1
Lines 9990 10075 +85
==========================================
- Hits 5259 5210 -49
- Misses 4266 4409 +143
+ Partials 465 456 -9
|
http.Request
http.Request
http.Request
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.
Looks like there's a lint issue, but otherwise I'm okay with it 🙏🏻 tested it myself (not the plaintext option yet, but that will be a really nice feature)
I'll make an issue for the commitment to also be returned for Submit.
I've already implemented it @renaynay |
FYI @jcstein, changes in Blob's commands:
|
thanks for the context! a question on this before opening a PR to the docs: are the rest of the methods still camelcase? this seems like it would get confusing as a user if we didn't change all methods. i.e.
|
suggestion: allow |
i also think we need to set the API version to match the expected node release version cc @MSevey @adlerjohn celestia rpc node Info
{
"jsonrpc": "2.0",
"result": {
"type": 2,
"api_version": "v0.2.1"
},
"id": 1
} |
Yeah, they will be fixed in subsequent PRs |
this plaintext flag is goated 👏 |
Overview
Ideas behind such rework are pretty simple:
Me and @Wondertan love generic code but IMO the rpc is too complicated and hard to understand and maintain. Also, it contained a lot of hidden bugs that were found by @jcstein(bug: illegal base64 data at input byte during unmarshalling blob.Commitment #2500, blob.GetAll not returning correct base64 data, GetShare and GetSharesByNamespace also don't work #2503). I believe that extracting each module(or even a method) to its own command will simplify this package a lot.
We've already had a rpc client but continue using http.Request. Also, the generic approach did not give us control over the returned value.
TODO: extract errors
Checklist