-
Notifications
You must be signed in to change notification settings - Fork 27
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
refactor(settings): refactor genesis module #794
Conversation
870ee5e
to
96b93db
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #794 +/- ##
==========================================
+ Coverage 84.65% 84.69% +0.04%
==========================================
Files 264 264
Lines 22034 22019 -15
Branches 3369 3364 -5
==========================================
- Hits 18652 18649 -3
+ Misses 2726 2717 -9
+ Partials 656 653 -3
☔ View full report in Codecov by Sentry. |
c700dc5
to
85a3bfc
Compare
96b93db
to
a0cdd3c
Compare
@msbrogli @jansegre as we discussed, in a86c175 I made the following changes:
|
a86c175
to
88ef27f
Compare
Depends on #787
Motivation
This PR not only removes any usage of global settings from the
genesis
module, but it also substitutes all global variables defined in this module by functions. It also includes some simplifications in code using that module.Acceptance Criteria
BLOCK_GENESIS, TX_GENESIS1, TX_GENESIS2, GENESIS, GENESIS_HASHES, GENESIS_HASH
global variables and implement, respectively,get_genesis_block(), get_genesis_tx1(), get_genesis_tx2(), get_all_genesis(), get_all_genesis_hashes(), get_genesis_hash()
. As these are not shared instances anymore, it's safe to manipulate the returned instance in tests, for example.get_genesis_hash()
andis_genesis()
implementations._get_genesis_transactions_unsafe()
function as after all refactors it was only used in one place.CliBuilder
to use the existingget_genesis_short_hash()
function.height_index.BLOCK_GENESIS_ENTRY
global variable and refactored it intoHeightIndex.get_genesis_block_entry()
.Checklist
master
, confirm this code is production-ready and can be included in future releases as soon as it gets merged