Move grandpa crates to consensus folder (#13458)

* Move grandpa under consensus dir
* Rename grandpa folder
* Finish grandpa renaming
* Minor tweaks
* Cargo fmt
* Adjust path to chain spec
This commit is contained in:
Davide Galassi
2023-02-27 17:15:08 +01:00
committed by GitHub
parent 91c595bc78
commit 40c36c0c8a
62 changed files with 356 additions and 356 deletions
+8 -8
View File
@@ -355,7 +355,7 @@ fn report_equivocation_current_set_works() {
// create the key ownership proof
let key_owner_proof =
Historical::prove((sp_finality_grandpa::KEY_TYPE, &equivocation_key)).unwrap();
Historical::prove((sp_consensus_grandpa::KEY_TYPE, &equivocation_key)).unwrap();
// report the equivocation and the tx should be dispatched successfully
assert_ok!(Grandpa::report_equivocation_unsigned(
@@ -408,7 +408,7 @@ fn report_equivocation_old_set_works() {
// create the key ownership proof in the "old" set
let key_owner_proof =
Historical::prove((sp_finality_grandpa::KEY_TYPE, &equivocation_key)).unwrap();
Historical::prove((sp_consensus_grandpa::KEY_TYPE, &equivocation_key)).unwrap();
start_era(2);
@@ -486,7 +486,7 @@ fn report_equivocation_invalid_set_id() {
let equivocation_keyring = extract_keyring(equivocation_key);
let key_owner_proof =
Historical::prove((sp_finality_grandpa::KEY_TYPE, &equivocation_key)).unwrap();
Historical::prove((sp_consensus_grandpa::KEY_TYPE, &equivocation_key)).unwrap();
let set_id = Grandpa::current_set_id();
@@ -524,7 +524,7 @@ fn report_equivocation_invalid_session() {
// generate a key ownership proof at set id = 1
let key_owner_proof =
Historical::prove((sp_finality_grandpa::KEY_TYPE, &equivocation_key)).unwrap();
Historical::prove((sp_consensus_grandpa::KEY_TYPE, &equivocation_key)).unwrap();
start_era(2);
@@ -563,7 +563,7 @@ fn report_equivocation_invalid_key_owner_proof() {
// generate a key ownership proof for the authority at index 1
let invalid_key_owner_proof =
Historical::prove((sp_finality_grandpa::KEY_TYPE, &invalid_owner_key)).unwrap();
Historical::prove((sp_consensus_grandpa::KEY_TYPE, &invalid_owner_key)).unwrap();
let equivocation_authority_index = 0;
let equivocation_key = &authorities[equivocation_authority_index].0;
@@ -610,7 +610,7 @@ fn report_equivocation_invalid_equivocation_proof() {
// generate a key ownership proof at set id = 1
let key_owner_proof =
Historical::prove((sp_finality_grandpa::KEY_TYPE, &equivocation_key)).unwrap();
Historical::prove((sp_consensus_grandpa::KEY_TYPE, &equivocation_key)).unwrap();
let set_id = Grandpa::current_set_id();
@@ -685,7 +685,7 @@ fn report_equivocation_validate_unsigned_prevents_duplicates() {
);
let key_owner_proof =
Historical::prove((sp_finality_grandpa::KEY_TYPE, &equivocation_key)).unwrap();
Historical::prove((sp_consensus_grandpa::KEY_TYPE, &equivocation_key)).unwrap();
let call = Call::report_equivocation_unsigned {
equivocation_proof: Box::new(equivocation_proof.clone()),
@@ -873,7 +873,7 @@ fn valid_equivocation_reports_dont_pay_fees() {
// create the key ownership proof.
let key_owner_proof =
Historical::prove((sp_finality_grandpa::KEY_TYPE, &equivocation_key)).unwrap();
Historical::prove((sp_consensus_grandpa::KEY_TYPE, &equivocation_key)).unwrap();
// check the dispatch info for the call.
let info = Call::<Test>::report_equivocation_unsigned {