-
Notifications
You must be signed in to change notification settings - Fork 290
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
[rpc] add RPC API contract.resolve_module_function_index #3464
[rpc] add RPC API contract.resolve_module_function_index #3464
Conversation
Hold on please, it'll cause panic if the |
2c7fa5d
to
172a6ae
Compare
$ curl 'http://localhost:9851/' -X POST -H 'Content-Type: application/json' --data-raw '{"method":"contract.resolve_module_function_index","params":["0x3c7430c3c2a3979a703f52d3eca3ae67::MyCounter", 4],"id":56,"jsonrpc":"2.0"}' {
"error": {
"code": -32603,
"message": "Function index 4 out of range in ModuleId { address: 0x3c7430c3c2a3979a703f52d3eca3ae67, name: Identifier(\"MyCounter\") }"
},
"id": 56,
"jsonrpc": "2.0"
} |
@coldnight Please help to add a unit test for |
@jolestar Unit tests have been added. |
Codecov Report
@@ Coverage Diff @@
## master #3464 +/- ##
==========================================
+ Coverage 31.95% 31.96% +0.02%
==========================================
Files 500 500
Lines 46806 46833 +27
Branches 21306 21327 +21
==========================================
+ Hits 14951 14966 +15
- Misses 17693 17698 +5
- Partials 14162 14169 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
LGTM
Related #3450.
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: #3450.
What is the new behavior?
Add an new RPC API that could resolve function index from CompiledModule.
Here is an example invocation in my own environment(deployed a toy mycounter contract)
The result I got
Other information