Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Wococo -> Rococo integrity tests
Browse files Browse the repository at this point in the history
  • Loading branch information
serban300 committed Dec 9, 2022
1 parent 57fd17b commit 0c8a7e2
Showing 1 changed file with 52 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,55 @@ impl ThisChainWithMessages for BridgeHubWococo {
MessageNonce::MAX / 2
}
}

#[cfg(test)]
mod tests {
use super::*;
use crate::BridgeGrandpaRococoInstance;
use bridge_runtime_common::{
assert_complete_bridge_types,
integrity::{
assert_complete_bridge_constants, AssertBridgeMessagesPalletConstants,
AssertBridgePalletNames, AssertChainConstants, AssertCompleteBridgeConstants,
},
};

#[test]
fn ensure_bridge_integrity() {
assert_complete_bridge_types!(
runtime: Runtime,
with_bridged_chain_grandpa_instance: BridgeGrandpaRococoInstance,
with_bridged_chain_messages_instance: WithBridgeHubRococoMessagesInstance,
bridge: WithBridgeHubRococoMessageBridge,
this_chain: bp_wococo::Wococo,
bridged_chain: bp_rococo::Rococo,
);

assert_complete_bridge_constants::<
Runtime,
BridgeGrandpaRococoInstance,
WithBridgeHubRococoMessagesInstance,
WithBridgeHubRococoMessageBridge,
bp_wococo::Wococo,
>(AssertCompleteBridgeConstants {
this_chain_constants: AssertChainConstants {
block_length: bp_wococo::BlockLength::get(),
block_weights: bp_wococo::BlockWeights::get(),
},
messages_pallet_constants: AssertBridgeMessagesPalletConstants {
max_unrewarded_relayers_in_bridged_confirmation_tx:
bp_bridge_hub_rococo::MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX,
max_unconfirmed_messages_in_bridged_confirmation_tx:
bp_bridge_hub_rococo::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX,
bridged_chain_id: bp_runtime::BRIDGE_HUB_ROCOCO_CHAIN_ID,
},
pallet_names: AssertBridgePalletNames {
with_this_chain_messages_pallet_name:
bp_bridge_hub_wococo::WITH_BRIDGE_HUB_WOCOCO_MESSAGES_PALLET_NAME,
with_bridged_chain_grandpa_pallet_name: bp_rococo::WITH_ROCOCO_GRANDPA_PALLET_NAME,
with_bridged_chain_messages_pallet_name:
bp_bridge_hub_rococo::WITH_BRIDGE_HUB_ROCOCO_MESSAGES_PALLET_NAME,
},
});
}
}

0 comments on commit 0c8a7e2

Please sign in to comment.