Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix tests #2794

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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