Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Closed
Changes from 2 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
4 changes: 2 additions & 2 deletions parachain/test-parachains/adder/src/wasm_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ use parachain::primitives::{ValidationResult, HeadData as GenericHeadData};
use codec::{Encode, Decode};

#[no_mangle]
pub extern "C" fn validate_block(params: *const u8, len: usize) -> u64 {
let params = unsafe { parachain::load_params(params, len) };
pub extern "C" fn validate_block(params: *const u8, len: u32) -> u64 {
let params = unsafe { parachain::load_params(params, len as u32) };
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand the motivation here if len is already u32 per the function definition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, I meant to cast it by usize 🙈 , I need to devote more attention to this PR.

let parent_head = HeadData::decode(&mut &params.parent_head.0[..])
.expect("invalid parent head format.");

Expand Down