This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Phragmén Validator Election #1915
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
89417a1
adds first draft phragmen with tuned tests and sr-primitives
kianenigma cf8157c
fix a few docs and code styles
kianenigma b0b8e21
clean, organize and finish remaining test cases
kianenigma 653456f
more and more tests
kianenigma ee38f86
update edge cases behavior and relavent tests
kianenigma f969335
fix global test issues
kianenigma 2c02b54
updated wasm files
kianenigma 89185ec
merged and tests almost patched
kianenigma baf8778
all tests fixed
kianenigma cfaf7b9
cleanup
kianenigma 9408b95
fix some global issues
kianenigma b2973a3
fix global tests
kianenigma e9b5244
bump versions
kianenigma cabdc5b
fix typo
kianenigma 9584ac7
first step toward extracting phragmen
kianenigma 747d650
Fix most of the grumbles.
kianenigma 216be37
Merge temp branch
kianenigma 9365327
fix rest of the grumbles
kianenigma d3ad7b4
spaces to tabs
kianenigma 938bd7b
update wasm
kianenigma ed487ec
Version bump and merge
kianenigma 043d182
Removed nightly feature.
kianenigma d605e26
Merge conflicts with master.
kianenigma 633bb37
More tests
kianenigma cac9d3f
merge conflicts with master
kianenigma f8b04a3
Fix broken tests.
kianenigma 3bd69ef
Bump and update wasm.
kianenigma 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
Binary file modified
BIN
+33 Bytes
(100%)
...st-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ mod tests { | |
use node_primitives::{Hash, BlockNumber, AccountId}; | ||
use runtime_primitives::traits::{Header as HeaderT, Hash as HashT}; | ||
use runtime_primitives::{generic, generic::Era, ApplyOutcome, ApplyError, ApplyResult, Perbill}; | ||
use {balances, indices, session, system, consensus, timestamp, treasury, contract}; | ||
use {balances, indices, session, system, staking, consensus, timestamp, treasury, contract}; | ||
use contract::ContractAddressFor; | ||
use system::{EventRecord, Phase}; | ||
use node_runtime::{Header, Block, UncheckedExtrinsic, CheckedExtrinsic, Call, Runtime, Balances, | ||
|
@@ -296,7 +296,11 @@ mod tests { | |
staking: Some(StakingConfig { | ||
sessions_per_era: 2, | ||
current_era: 0, | ||
stakers: vec![(dave(), alice(), 111), (eve(), bob(), 101), (ferdie(), charlie(), 100)], | ||
stakers: vec![ | ||
(dave(), alice(), 111, staking::StakerStatus::Validator), | ||
(eve(), bob(), 100, staking::StakerStatus::Validator), | ||
(ferdie(), charlie(), 100, staking::StakerStatus::Validator) | ||
], | ||
validator_count: 3, | ||
minimum_validator_count: 0, | ||
bonding_duration: 0, | ||
|
@@ -441,7 +445,13 @@ mod tests { | |
] | ||
); | ||
|
||
let digest = generic::Digest::<Log>::default(); | ||
// let mut digest = generic::Digest::<Log>::default(); | ||
// digest.push(Log::from(::grandpa::RawLog::AuthoritiesChangeSignal(0, vec![ | ||
// (Keyring::Charlie.to_raw_public().into(), 1), | ||
// (Keyring::Bob.to_raw_public().into(), 1), | ||
// (Keyring::Alice.to_raw_public().into(), 1), | ||
// ]))); | ||
let digest = generic::Digest::<Log>::default(); // TODO test this | ||
assert_eq!(Header::decode(&mut &block2.0[..]).unwrap().digest, digest); | ||
|
||
(block1, block2) | ||
|
@@ -574,6 +584,14 @@ mod tests { | |
phase: Phase::Finalization, | ||
event: Event::session(session::RawEvent::NewSession(1)) | ||
}, | ||
// EventRecord { // TODO: this might be wrong. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same and no |
||
// phase: Phase::Finalization, | ||
// event: Event::grandpa(::grandpa::RawEvent::NewAuthorities(vec![ | ||
// (Keyring::Charlie.to_raw_public().into(), 1), | ||
// (Keyring::Bob.to_raw_public().into(), 1), | ||
// (Keyring::Alice.to_raw_public().into(), 1), | ||
// ])), | ||
// }, | ||
EventRecord { | ||
phase: Phase::Finalization, | ||
event: Event::treasury(treasury::RawEvent::Spending(0)) | ||
|
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
Binary file modified
BIN
-3.72 KB
(100%)
node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
No un-commented code please.