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

Beacon state: Add interfaces #8544

Merged
merged 12 commits into from
Mar 3, 2021
Merged

Conversation

terencechain
Copy link
Member

What type of PR is this?

Feature

What does this PR do? Why is it needed?

As in preparation for revamping state usages for hardfork, this PR implements the interfaces around state pkg getters and setters. The interfaces are broken down by major functionality as well as read only and write only.

One caveat is I had to use iface.ReadOnlyValidator right away to satisfy var _ iface.BeaconState = (*BeaconState)(nil). The changes for that isn't bad. I hope we don't mind squeezing it in the same PR.

The follow up PRs will be using these interfaces

Which issues(s) does this PR fix?

N/A

Other notes for review

Tested run time

@terencechain terencechain added the Ready For Review A pull request ready for code review label Mar 2, 2021
@terencechain terencechain self-assigned this Mar 2, 2021
@terencechain terencechain requested a review from a team as a code owner March 2, 2021 17:27
}

// ReadOnlyBeaconState defines a struct which only has read access to beacon state methods.
type ReadOnlyBeaconState interface {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should move the state ifaces to the top of the file to make them easier to find

rauljordan
rauljordan previously approved these changes Mar 2, 2021
@codecov
Copy link

codecov bot commented Mar 2, 2021

Codecov Report

❗ No coverage uploaded for pull request base (develop@090fbbf). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             develop    #8544   +/-   ##
==========================================
  Coverage           ?   58.26%           
==========================================
  Files              ?      462           
  Lines              ?    33072           
  Branches           ?        0           
==========================================
  Hits               ?    19268           
  Misses             ?    10875           
  Partials           ?     2929           

@prylabs-bulldozer prylabs-bulldozer bot merged commit c6b74b2 into develop Mar 3, 2021
@delete-merged-branch delete-merged-branch bot deleted the beacon-state-interface branch March 3, 2021 02:26
@terencechain terencechain mentioned this pull request Mar 21, 2021
62 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants