Skip to content

Commit

Permalink
fix tests (#2794)
Browse files Browse the repository at this point in the history
  • Loading branch information
zjb0807 authored Aug 22, 2024
1 parent 8ae2a8e commit 50b1e21
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
20 changes: 18 additions & 2 deletions runtime/integration-tests/src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ use sp_consensus_aura::AURA_ENGINE_ID;
pub use sp_core::H160;
use sp_io::hashing::keccak_256;
pub use sp_runtime::{
traits::{AccountIdConversion, BadOrigin, BlakeTwo256, Convert, Hash, Zero},
traits::{AccountIdConversion, BadOrigin, BlakeTwo256, Convert, Hash, Header, Zero},
BuildStorage, Digest, DigestItem, DispatchError, DispatchResult, FixedPointNumber, FixedU128, MultiAddress,
Perbill, Permill,
};
Expand Down Expand Up @@ -233,7 +233,23 @@ pub fn set_relaychain_block_number(number: BlockNumber) {
AuraExt::on_initialize(number);
ParachainSystem::on_initialize(number);

let (relay_storage_root, proof) = RelayStateSproofBuilder::default().into_state_root_and_proof();
let mut sproof_builder = RelayStateSproofBuilder::default();

let parent_head_data = {
let header = cumulus_primitives_core::relay_chain::Header::new(
number,
sp_core::H256::from_low_u64_be(0),
sp_core::H256::from_low_u64_be(0),
Default::default(),
Default::default(),
);
cumulus_primitives_core::relay_chain::HeadData(header.encode())
};

sproof_builder.para_id = ParachainInfo::get().into();
sproof_builder.included_para_head = Some(parent_head_data.clone());

let (relay_storage_root, proof) = sproof_builder.into_state_root_and_proof();

assert_ok!(ParachainSystem::set_validation_data(
RuntimeOrigin::none(),
Expand Down
1 change: 0 additions & 1 deletion runtime/integration-tests/src/vesting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ use crate::setup::*;
use orml_vesting::VestingSchedule;

#[test]
#[ignore] // TODO: fix the relaychain block number proof
fn test_vesting_use_relaychain_block_number() {
ExtBuilder::default().build().execute_with(|| {
#[cfg(feature = "with-mandala-runtime")]
Expand Down

0 comments on commit 50b1e21

Please sign in to comment.