-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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: add listcontracts endpoint #1608
Conversation
18c55de
to
0bbb850
Compare
Pull Request Test Coverage Report for Build 650c2e71-7717-4778-b171-ee1718c2e0cd
💛 - Coveralls |
}, | ||
%{ | ||
code: "200", | ||
description: "error", |
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.
I can't understand this example. error with status code 200?
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.
Honestly, this is just the error description that everything uses. I don't know why, but it returns a 200 code but its an error everywhere in the rpc :(
895a561
to
bf50b9c
Compare
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.
@zachdaniel Could you please add a screenshot of how will API endpoint look on the APIs page? And please update CHNAGELOG.md
bf50b9c
to
e285dae
Compare
@zachdaniel #1596 has been merged |
a2c98d5
to
cfb4647
Compare
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.
I've tried it locally with Sokol. I've found some bugs. I don't know, would you continue to fix them in this PR or you will do this in a separate one where you will implement #1569 (comment). Please, let me know. The list of the bugs is below:
- I think we could extend the output data model with the decompiler version.
&filter=unverified
or&filter=not_decompiled
- Not only smart-contracts are returned, but also simple address without contact code. I suppose we should return only smart-contracts for all filters in this endpoint
@zachdaniel in addition, If I choose incorrect filter (which is unlisted) it returns me all addresses instead of returning of empty list |
The pattern in the RPC that I could see was to ignore parameters that were invalid (not my preferred way of doing it, just what was being done before. I would be fine with returning an error response instead of just returning all results, but I wouldn't want to return an empty list. Also, yeah this should definitely only have addresses with |
11b3c7c
to
4d5b42b
Compare
4d5b42b
to
e694d14
Compare
The first part of #1569
This adds an rpc endpoint to list contracts according to the spec on that issue. We will probably want to leave this open until #1596 is merged, so that I can add those filters to this PR
Changelog
Enhancements
Address
to the contract model, to support the list endpoint.