mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 10:11:03 +00:00
pallet-beefy: ensure mandatory block once per session (#11269)
* pallet-beefy: ensure mandatory block once per session Signed-off-by: acatangiu <adrian@parity.io> * pallet-beefy: fix tests with auth changes every session Signed-off-by: acatangiu <adrian@parity.io> * Apply suggestions from code review Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com> * beefy: fix incorrect skip session metric on node restart Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
This commit is contained in:
@@ -70,9 +70,14 @@ fn should_contain_mmr_digest() {
|
||||
|
||||
assert_eq!(
|
||||
System::digest().logs,
|
||||
vec![beefy_log(ConsensusLog::MmrRoot(
|
||||
hex!("fa0275b19b2565089f7e2377ee73b9050e8d53bce108ef722a3251fd9d371d4b").into()
|
||||
))]
|
||||
vec![
|
||||
beefy_log(ConsensusLog::AuthoritiesChange(
|
||||
ValidatorSet::new(vec![mock_beefy_id(1), mock_beefy_id(2)], 1).unwrap()
|
||||
)),
|
||||
beefy_log(ConsensusLog::MmrRoot(
|
||||
hex!("95803defe6ea9f41e7ec6afa497064f21bfded027d8812efacbdf984e630cbdc").into()
|
||||
))
|
||||
]
|
||||
);
|
||||
|
||||
// unique every time
|
||||
@@ -81,14 +86,17 @@ fn should_contain_mmr_digest() {
|
||||
assert_eq!(
|
||||
System::digest().logs,
|
||||
vec![
|
||||
beefy_log(ConsensusLog::AuthoritiesChange(
|
||||
ValidatorSet::new(vec![mock_beefy_id(1), mock_beefy_id(2)], 1).unwrap()
|
||||
)),
|
||||
beefy_log(ConsensusLog::MmrRoot(
|
||||
hex!("fa0275b19b2565089f7e2377ee73b9050e8d53bce108ef722a3251fd9d371d4b").into()
|
||||
hex!("95803defe6ea9f41e7ec6afa497064f21bfded027d8812efacbdf984e630cbdc").into()
|
||||
)),
|
||||
beefy_log(ConsensusLog::AuthoritiesChange(
|
||||
ValidatorSet::new(vec![mock_beefy_id(3), mock_beefy_id(4),], 1,).unwrap()
|
||||
ValidatorSet::new(vec![mock_beefy_id(3), mock_beefy_id(4)], 2).unwrap()
|
||||
)),
|
||||
beefy_log(ConsensusLog::MmrRoot(
|
||||
hex!("85554fa7d4e863cce3cdce668c1ae82c0174ad37f8d1399284018bec9f9971c3").into()
|
||||
hex!("a73271a0974f1e67d6e9b8dd58e506177a2e556519a330796721e98279a753e2").into()
|
||||
)),
|
||||
]
|
||||
);
|
||||
@@ -109,9 +117,9 @@ fn should_contain_valid_leaf_data() {
|
||||
version: MmrLeafVersion::new(1, 5),
|
||||
parent_number_and_hash: (0_u64, H256::repeat_byte(0x45)),
|
||||
beefy_next_authority_set: BeefyNextAuthoritySet {
|
||||
id: 1,
|
||||
id: 2,
|
||||
len: 2,
|
||||
root: hex!("176e73f1bf656478b728e28dd1a7733c98621b8acf830bff585949763dca7a96")
|
||||
root: hex!("9c6b2c1b0d0b25a008e6c882cc7b415f309965c72ad2b944ac0931048ca31cd5")
|
||||
.into(),
|
||||
},
|
||||
leaf_extra: hex!("55b8e9e1cc9f0db7776fac0ca66318ef8acfb8ec26db11e373120583e07ee648")
|
||||
@@ -131,7 +139,7 @@ fn should_contain_valid_leaf_data() {
|
||||
version: MmrLeafVersion::new(1, 5),
|
||||
parent_number_and_hash: (1_u64, H256::repeat_byte(0x45)),
|
||||
beefy_next_authority_set: BeefyNextAuthoritySet {
|
||||
id: 2,
|
||||
id: 3,
|
||||
len: 2,
|
||||
root: hex!("9c6b2c1b0d0b25a008e6c882cc7b415f309965c72ad2b944ac0931048ca31cd5")
|
||||
.into(),
|
||||
|
||||
Reference in New Issue
Block a user