-
Notifications
You must be signed in to change notification settings - Fork 147
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
Accept genesis state and parameter overrides #123
Merged
Merged
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
92be1bc
Provide facility to override genesis parameters; Reconcile reset_to_g…
KPrasch 4314629
Add tests for overridable genesis parameters.
KPrasch ee287cf
Fix code style and convention
KPrasch ee15807
Improve Exception handing for genesis overrides; Use non-mutitive gen…
KPrasch ecfd251
Expose genesis overrides only at the backend level.
KPrasch b57d189
Refactor genesis parameter override test to use static method.
KPrasch ef4bb2f
Cleanup code style.
KPrasch 3a969f6
Accept optional genesis state overrides (lower-level)
KPrasch e2a1074
Optional test account quantity when creating keypairs.
KPrasch 1690354
Use state overrides; Generate an equal number of keypairs and custom …
KPrasch 23e0b26
Use dedicated utility function for genesis parameter merging
KPrasch d213465
Fix a small found typo in an error message
KPrasch 9ccb132
Test customizable genesis parameter and state merging functionality; …
KPrasch a199741
Increased test accuracy and coverage for genesis parameter and state …
KPrasch e76eb55
Clarify state override naming
KPrasch 82972f4
remove from_genesis_overrides classmethod
KPrasch 482fa29
Mark PyEVM genesis override methods private
KPrasch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from cytoolz.dicttoolz import merge | ||
|
||
|
||
def merge_genesis_overrides(defaults, overrides): | ||
allowed_fields = set(defaults.keys()) | ||
override_fields = set(overrides.keys()) | ||
unexpected_fields = tuple(sorted(override_fields.difference(allowed_fields))) | ||
|
||
if unexpected_fields: | ||
err = "The following invalid fields were supplied to override default genesis values: {0}." | ||
raise ValueError(err.format(unexpected_fields)) | ||
|
||
merged_params = merge(defaults, overrides) | ||
return merged_params |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
can you wrap this line?
too bad that
eth-tester
doesn't have isort!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.
✔️