mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 11:01:01 +00:00
Add integrity tests to rialto parachain runtiime (#2096)
* add integrity tests to rialto-parachain runtime * post cherry-pick fixes
This commit is contained in:
committed by
Bastian Köcher
parent
e08efd9104
commit
77b2ef5f6e
@@ -76,6 +76,7 @@ pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "master"
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
bridge-runtime-common = { path = "../../runtime-common", features = ["integrity-test"] }
|
bridge-runtime-common = { path = "../../runtime-common", features = ["integrity-test"] }
|
||||||
|
static_assertions = "1.1"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ['std']
|
default = ['std']
|
||||||
|
|||||||
@@ -134,3 +134,64 @@ impl XcmBlobHauler for ToMillauXcmBlobHauler {
|
|||||||
XCM_LANE
|
XCM_LANE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
use crate::{MillauGrandpaInstance, Runtime, WithMillauMessagesInstance};
|
||||||
|
use bridge_runtime_common::{
|
||||||
|
assert_complete_bridge_types,
|
||||||
|
integrity::{
|
||||||
|
assert_complete_bridge_constants, check_message_lane_weights,
|
||||||
|
AssertBridgeMessagesPalletConstants, AssertBridgePalletNames, AssertChainConstants,
|
||||||
|
AssertCompleteBridgeConstants,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn ensure_millau_message_lane_weights_are_correct() {
|
||||||
|
check_message_lane_weights::<bp_rialto_parachain::RialtoParachain, Runtime>(
|
||||||
|
bp_millau::EXTRA_STORAGE_PROOF_SIZE,
|
||||||
|
bp_rialto_parachain::MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX,
|
||||||
|
bp_rialto_parachain::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn ensure_bridge_integrity() {
|
||||||
|
assert_complete_bridge_types!(
|
||||||
|
runtime: Runtime,
|
||||||
|
with_bridged_chain_grandpa_instance: MillauGrandpaInstance,
|
||||||
|
with_bridged_chain_messages_instance: WithMillauMessagesInstance,
|
||||||
|
bridge: WithMillauMessageBridge,
|
||||||
|
this_chain: bp_rialto_parachain::RialtoParachain,
|
||||||
|
bridged_chain: bp_millau::Millau,
|
||||||
|
);
|
||||||
|
|
||||||
|
assert_complete_bridge_constants::<
|
||||||
|
Runtime,
|
||||||
|
MillauGrandpaInstance,
|
||||||
|
WithMillauMessagesInstance,
|
||||||
|
WithMillauMessageBridge,
|
||||||
|
>(AssertCompleteBridgeConstants {
|
||||||
|
this_chain_constants: AssertChainConstants {
|
||||||
|
block_length: bp_rialto_parachain::BlockLength::get(),
|
||||||
|
block_weights: bp_rialto_parachain::BlockWeights::get(),
|
||||||
|
},
|
||||||
|
messages_pallet_constants: AssertBridgeMessagesPalletConstants {
|
||||||
|
max_unrewarded_relayers_in_bridged_confirmation_tx:
|
||||||
|
bp_millau::MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX,
|
||||||
|
max_unconfirmed_messages_in_bridged_confirmation_tx:
|
||||||
|
bp_millau::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX,
|
||||||
|
bridged_chain_id: bp_runtime::MILLAU_CHAIN_ID,
|
||||||
|
},
|
||||||
|
pallet_names: AssertBridgePalletNames {
|
||||||
|
with_this_chain_messages_pallet_name:
|
||||||
|
bp_rialto_parachain::WITH_RIALTO_PARACHAIN_MESSAGES_PALLET_NAME,
|
||||||
|
with_bridged_chain_grandpa_pallet_name: bp_millau::WITH_MILLAU_GRANDPA_PALLET_NAME,
|
||||||
|
with_bridged_chain_messages_pallet_name:
|
||||||
|
bp_millau::WITH_MILLAU_MESSAGES_PALLET_NAME,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user