mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 18:41:03 +00:00
Add tests that check the value of MQCs (#2351)
* DMP * HRMP * Update runtime/parachains/src/dmp.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -226,6 +226,7 @@ impl<T: Config> Module<T> {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use hex_literal::hex;
|
||||
use primitives::v1::BlockNumber;
|
||||
use frame_support::StorageValue;
|
||||
use frame_support::traits::{OnFinalize, OnInitialize};
|
||||
@@ -322,6 +323,25 @@ mod tests {
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn dmp_mqc_head_fixture() {
|
||||
let a = ParaId::from(2000);
|
||||
|
||||
new_test_ext(default_genesis_config()).execute_with(|| {
|
||||
run_to_block(2, None);
|
||||
assert!(Dmp::dmq_mqc_head(a).is_zero());
|
||||
queue_downward_message(a, vec![1, 2, 3]).unwrap();
|
||||
|
||||
run_to_block(3, None);
|
||||
queue_downward_message(a, vec![4, 5, 6]).unwrap();
|
||||
|
||||
assert_eq!(
|
||||
Dmp::dmq_mqc_head(a),
|
||||
hex!["88dc00db8cc9d22aa62b87807705831f164387dfa49f80a8600ed1cbe1704b6b"].into(),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn check_processed_downward_messages() {
|
||||
let a = ParaId::from(1312);
|
||||
|
||||
Reference in New Issue
Block a user