diff --git a/cumulus/runtime/src/validate_block/tests.rs b/cumulus/runtime/src/validate_block/tests.rs index 4d1d336a67..8289d33889 100644 --- a/cumulus/runtime/src/validate_block/tests.rs +++ b/cumulus/runtime/src/validate_block/tests.rs @@ -152,4 +152,25 @@ fn validate_block_with_extrinsics() { witness_data_storage_root ); call_validate_block(client.genesis_hash(), block_data).expect("Calls `validate_block`"); -} \ No newline at end of file +} + +#[test] +#[should_panic] +fn validate_block_invalid_parent_hash() { + let client = create_test_client(); + let witness_data_storage_root = *client + .best_block_header() + .expect("Best block exists") + .state_root(); + let (block, witness_data) = build_block_with_proof(&client, Vec::new()); + let (mut header, extrinsics) = block.deconstruct(); + header.set_parent_hash(Hash::from_low_u64_be(1)); + + let block_data = ParachainBlockData::new( + header, + extrinsics, + witness_data, + witness_data_storage_root + ); + call_validate_block(client.genesis_hash(), block_data).expect("Calls `validate_block`"); +}