Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
WIP
Forked at: 461b971
Parent branch: origin/master
  • Loading branch information
cecton committed Apr 8, 2020
commit bb9e23b5fb18c848c7691b6a60004e18bffaa41a
12 changes: 8 additions & 4 deletions runtime/src/validate_block/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

use crate::{ParachainBlockData, WitnessData};

use parachain::{ValidationParams, ValidationResult};
use parachain::primitives::{BlockData, HeadData, ValidationParams, ValidationResult};
use sc_executor::{
error::Result, WasmExecutionMethod, WasmExecutor, sp_wasm_interface::HostFunctions,
};
Expand Down Expand Up @@ -44,8 +44,12 @@ fn call_validate_block(
let mut ext = TestExternalities::default();
let mut ext_ext = ext.ext();
let params = ValidationParams {
block_data: block_data.encode(),
parent_head: parent_head.encode(),
block_data: BlockData(block_data.encode()),
parent_head: HeadData(parent_head.encode()),
code_upgrade_allowed: None,
max_code_size: 1024,
max_head_data_size: 1024,
relay_chain_height: 1,
Comment on lines +49 to +52
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took the defaults from what I found in substrate

}
.encode();

Expand All @@ -65,7 +69,7 @@ fn call_validate_block(
&mut ext_ext,
)
.map(|v| ValidationResult::decode(&mut &v[..]).expect("Decode `ValidationResult`."))
.map(|v| Header::decode(&mut &v.head_data[..]).expect("Decode `Header`."))
.map(|v| Header::decode(&mut &v.head_data.0[..]).expect("Decode `Header`."))
.map_err(|err| err.into())
}

Expand Down