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

Use the Jsonrpc types as the abstraction layer in the store interfaces #877

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

ferranbt
Copy link
Contributor

@ferranbt ferranbt commented Nov 5, 2022

Description

Use the types from the jsonrpc package on the abstraction interface.

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Breaking changes

Please complete this section if any breaking changes have been made, otherwise delete it

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels
  • I have updated the official documentation
  • I have added sufficient documentation in code

Testing

  • I have tested this code with the official test suite
  • I have tested this code manually

Manual tests

Please complete this section if you ran manual tests for this functionality, otherwise delete it

Documentation update

Please link the documentation update PR in this section if it's present, otherwise delete it

Additional comments

Please post additional comments in this section if you have them, otherwise delete it

@ferranbt ferranbt changed the title Ferranbt experimental jsonrpc abstract types Use the Jsonrpc types as the abstraction layer in the store interfaces Nov 5, 2022
@ferranbt ferranbt added the don't merge Please don't merge this functionality temporarily label Nov 5, 2022

// GetHeaderByNumber returns the header by number
GetHeaderByNumber(block uint64) (*types.Header, bool)
Header() *Block
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does header function return block? =)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the name should be changed. The idea is that for the jsonrpc module there is no difference between Block and Header. Thus, we should return only jsonrpc.Block. The name has to change too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I think about it, Header is not a good name either for what it does. It should be LatestHeader or something like that.

@@ -821,13 +675,13 @@ func (e *Eth) Unsubscribe(id string) (bool, error) {
return e.filterManager.Uninstall(id), nil
}

func (e *Eth) getBlockHeader(number BlockNumber) (*types.Header, error) {
func (e *Eth) getBlockHeader(number BlockNumber) (*Block, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as before.

@ferranbt ferranbt force-pushed the ferranbt-experimental-jsonrpc-abstract-types branch from f73adfc to 0bce5df Compare November 9, 2022 08:56
@0xPolygon 0xPolygon deleted a comment from CLAassistant Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
don't merge Please don't merge this functionality temporarily
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants