-
Notifications
You must be signed in to change notification settings - Fork 566
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
Cmd settings to config #501
Cmd settings to config #501
Conversation
Codecov Report
@@ Coverage Diff @@
## master #501 +/- ##
==========================================
+ Coverage 88.35% 88.44% +0.09%
==========================================
Files 56 56
Lines 6104 6138 +34
Branches 1348 1355 +7
==========================================
+ Hits 5393 5429 +36
+ Misses 489 485 -4
- Partials 222 224 +2
Continue to review full report at Codecov.
|
Rebasing in #503 should fix the failing tests. |
Accepts a unit as string and will return a Fixed number converted to the desired unit type
Project specific cmd_settings for ganache-cli new params: --time, --blockTime, --defaultBalanceEther loading a project will update the network settings with project specific settings
- better validation of cmd_settings with error handling - added block_time() to Rpc to get the time in seconds between blocks if specified - added support for --time parameter
added brownie-config.yaml for test project tests to verify that project specific configs update networks
8626ef6
to
90fca4b
Compare
No way to reliably query it from an attached instance
will only copy the brownie-config.yaml file when needed will now properly open, close and reset the network
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.
Looking good overall, a few things to address and a couple questions. Thanks for your work on this!
replace shutil.copy with yaml.dump and dump the config string into the project root testprojectconfig fixture no longer necessary, additional logic moved to settings_proj fixture
better messages and Brownie specific classes for warning changed type checking to isinstance
changed ValueError to TypeError
add "cmd_settings: {}" to default-config.yaml to indicate that these can be specified
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.
Looks great! Just a few minor things.
- removed test file cleanup - changed default cmd_settings from {} to null - made _recursive_update null-safe - replaced yaml.load with yaml.safe_load - moved yield outside load context - improved import statements in test_wei.py
What I did
Exposed
block_time
,default_balance
andtime
ganache-cli parametersAdded cmd_settings to project config file
Added Wei.to() to convert wei to other units
Related issue: #486
How I did it
Project settings update network settings on project load
Wei.to() operates with Brownie's Fixed class
How to verify it
Checklist