Skip to content
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

Node API Refactor - pt1 (Stage 2.1 of Node API Overhaul) #3244

Merged
merged 23 commits into from
Jul 22, 2020

Conversation

Daniel-VDM
Copy link
Contributor

Stage 2.1 of Node API Overhaul

This PR removes the usage of the Backend interface and fuses the APIBackend and Harmony objects together to provide a streamlined way to add RPCs.

This PR also fixes some minor bugs, unhandled responses, and formatting. Moreover, it separates methods of Harmony into different files for clarity. Some methods of hmyapi were removed as they were not used.

Daniel-VDM and others added 17 commits July 20, 2020 22:59
Fix docker image in README

Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* Add internals for APIBackend & Harmony fuse
* Add skeleton for refactor of GetTotalStakingSnapshot

Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* Add 'FIXME:done' comments to indicate implemented methods,
some were left out as they are simple accessors and will transition to using
the exposed harmony attributes.
* Split functions into standalone files for clarity.

Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
Previous implementation used rps.LatestBlockNumber, which is a constant -1,
thus, the cache was never used

Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
…f Backend

Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
…ead of Backend

Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* Fix unhandled errors

Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* Remove irrelevant TODOs

Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* Update hmyapi net.go to return ChainID as Version
* Remove unused err return on New Harmony obj

Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* Fix lint

Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
@Daniel-VDM Daniel-VDM added the rpc RPC or API label Jul 22, 2020
@Daniel-VDM Daniel-VDM requested a review from rlan35 July 22, 2020 16:42
@Daniel-VDM Daniel-VDM self-assigned this Jul 22, 2020
@Daniel-VDM Daniel-VDM added the refactor refactor label Jul 22, 2020
@Daniel-VDM Daniel-VDM changed the title Node API Refactor (Stage 2.1 of Node API Overhaul) [WIP]Node API Refactor (Stage 2.1 of Node API Overhaul) Jul 22, 2020
This is to satisfy existing interfaces, mainly the in filters.

Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
This is for testing from eth if we need it in the future

Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
@Daniel-VDM Daniel-VDM changed the title [WIP]Node API Refactor (Stage 2.1 of Node API Overhaul) Node API Refactor (Stage 2.1 of Node API Overhaul) Jul 22, 2020
@Daniel-VDM Daniel-VDM merged commit d4df3aa into harmony-one:main Jul 22, 2020
@Daniel-VDM Daniel-VDM changed the title Node API Refactor (Stage 2.1 of Node API Overhaul) Node API Refactor - pt1 (Stage 2.1 of Node API Overhaul) Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor refactor rpc RPC or API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants