mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 14:01:02 +00:00
Bridges subtree sync (#2991)
* Squashed 'bridges/' changes from 0417308a48..278119fec2 278119fec2 Grandpa: Store the authority set changes (#2336) (#2337) 19f9c8ffdb remove message sender origin (#2322) 3c7c271d2e GRANDPA module: store accepted justifications (#2298) (#2301) fb7d12e793 GRANDPA justifications: equivocation detection primitives (#2295) (#2297) d03a2ed450 More backports from Cumulus subtree to polkadot-staging (#2283) 3c4ada921b Update dependecies (#2277) (#2281) 3e195c9e76 GRANDPA: optimize votes_ancestries when needed (#2262) (#2264) 7065bbabc6 Implement RuntimeDebug for GrandpaJustification (#2254) 8c9e59bcbc Define generate_grandpa_key_ownership_proof() (#2247) (#2248) 0b46956df7 Deduplicate Grandpa consensus log reading logic (#2245) (#2246) 96c9701710 Fix deps from Cumulus (#2244) git-subtree-dir: bridges git-subtree-split: 278119fec2b45990cf1271999b0c21befe7003d9 * Subtree update * Squashed 'bridges/' changes from 278119fec2..edf33a2c85 edf33a2c85 Backport fix (for wasm `std` env) (#2339) git-subtree-dir: bridges git-subtree-split: edf33a2c85399d366e008228f2d9e63e8a492d95
This commit is contained in:
@@ -691,12 +691,13 @@ pub(crate) mod tests {
|
||||
use super::*;
|
||||
use crate::mock::{
|
||||
run_test, test_relay_header, BigParachainHeader, RegularParachainHasher,
|
||||
RegularParachainHeader, RuntimeEvent as TestEvent, RuntimeOrigin, TestRuntime,
|
||||
UNTRACKED_PARACHAIN_ID,
|
||||
RegularParachainHeader, RelayBlockHeader, RuntimeEvent as TestEvent, RuntimeOrigin,
|
||||
TestRuntime, UNTRACKED_PARACHAIN_ID,
|
||||
};
|
||||
use bp_test_utils::prepare_parachain_heads_proof;
|
||||
use codec::Encode;
|
||||
|
||||
use bp_header_chain::{justification::GrandpaJustification, HeaderGrandpaInfo};
|
||||
use bp_parachains::{
|
||||
BestParaHeadHash, BridgeParachainCall, ImportedParaHeadsKeyProvider, ParasInfoKeyProvider,
|
||||
};
|
||||
@@ -740,7 +741,10 @@ pub(crate) mod tests {
|
||||
test_relay_header(0, state_root).hash()
|
||||
}
|
||||
|
||||
fn proceed(num: RelayBlockNumber, state_root: RelayBlockHash) -> ParaHash {
|
||||
fn proceed(
|
||||
num: RelayBlockNumber,
|
||||
state_root: RelayBlockHash,
|
||||
) -> (ParaHash, GrandpaJustification<RelayBlockHeader>) {
|
||||
pallet_bridge_grandpa::Pallet::<TestRuntime, BridgesGrandpaPalletInstance>::on_initialize(
|
||||
0,
|
||||
);
|
||||
@@ -752,11 +756,11 @@ pub(crate) mod tests {
|
||||
pallet_bridge_grandpa::Pallet::<TestRuntime, BridgesGrandpaPalletInstance>::submit_finality_proof(
|
||||
RuntimeOrigin::signed(1),
|
||||
Box::new(header),
|
||||
justification,
|
||||
justification.clone(),
|
||||
)
|
||||
);
|
||||
|
||||
hash
|
||||
(hash, justification)
|
||||
}
|
||||
|
||||
fn initial_best_head(parachain: u32) -> ParaInfo {
|
||||
@@ -993,7 +997,7 @@ pub(crate) mod tests {
|
||||
);
|
||||
|
||||
// import head#10 of parachain#1 at relay block #1
|
||||
let relay_1_hash = proceed(1, state_root_10);
|
||||
let (relay_1_hash, justification) = proceed(1, state_root_10);
|
||||
assert_ok!(import_parachain_1_head(1, state_root_10, parachains_10, proof_10));
|
||||
assert_eq!(
|
||||
ParasInfo::<TestRuntime>::get(ParaId(1)),
|
||||
@@ -1032,6 +1036,10 @@ pub(crate) mod tests {
|
||||
pallet_bridge_grandpa::Event::UpdatedBestFinalizedHeader {
|
||||
number: 1,
|
||||
hash: relay_1_hash,
|
||||
grandpa_info: HeaderGrandpaInfo {
|
||||
justification,
|
||||
authority_set: None,
|
||||
},
|
||||
}
|
||||
),
|
||||
topics: vec![],
|
||||
@@ -1149,7 +1157,7 @@ pub(crate) mod tests {
|
||||
|
||||
// try to import head#0 of parachain#1 at relay block#1
|
||||
// => call succeeds, but nothing is changed
|
||||
let relay_1_hash = proceed(1, state_root);
|
||||
let (relay_1_hash, justification) = proceed(1, state_root);
|
||||
assert_ok!(import_parachain_1_head(1, state_root, parachains, proof));
|
||||
assert_eq!(ParasInfo::<TestRuntime>::get(ParaId(1)), Some(initial_best_head(1)));
|
||||
assert_eq!(
|
||||
@@ -1169,6 +1177,10 @@ pub(crate) mod tests {
|
||||
pallet_bridge_grandpa::Event::UpdatedBestFinalizedHeader {
|
||||
number: 1,
|
||||
hash: relay_1_hash,
|
||||
grandpa_info: HeaderGrandpaInfo {
|
||||
justification,
|
||||
authority_set: None,
|
||||
}
|
||||
}
|
||||
),
|
||||
topics: vec![],
|
||||
@@ -1197,7 +1209,7 @@ pub(crate) mod tests {
|
||||
initialize(state_root_5);
|
||||
|
||||
// head#10 of parachain#1 at relay block#1
|
||||
let relay_1_hash = proceed(1, state_root_10);
|
||||
let (relay_1_hash, justification) = proceed(1, state_root_10);
|
||||
assert_ok!(import_parachain_1_head(1, state_root_10, parachains_10, proof_10));
|
||||
assert_eq!(
|
||||
ParasInfo::<TestRuntime>::get(ParaId(1)),
|
||||
@@ -1218,6 +1230,10 @@ pub(crate) mod tests {
|
||||
pallet_bridge_grandpa::Event::UpdatedBestFinalizedHeader {
|
||||
number: 1,
|
||||
hash: relay_1_hash,
|
||||
grandpa_info: HeaderGrandpaInfo {
|
||||
justification: justification.clone(),
|
||||
authority_set: None,
|
||||
}
|
||||
}
|
||||
),
|
||||
topics: vec![],
|
||||
@@ -1255,6 +1271,10 @@ pub(crate) mod tests {
|
||||
pallet_bridge_grandpa::Event::UpdatedBestFinalizedHeader {
|
||||
number: 1,
|
||||
hash: relay_1_hash,
|
||||
grandpa_info: HeaderGrandpaInfo {
|
||||
justification,
|
||||
authority_set: None,
|
||||
}
|
||||
}
|
||||
),
|
||||
topics: vec![],
|
||||
|
||||
Reference in New Issue
Block a user