Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Fix runtime interface tests on Windows #4805

Merged
merged 2 commits into from
Feb 10, 2020
Merged
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
2 changes: 2 additions & 0 deletions primitives/runtime-interface/test-wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,15 @@ pub trait TestApi {
/// Two random external functions from the old runtime interface.
/// This ensures that we still inherently export these functions from the host and that we are still
/// compatible with old wasm runtimes.
#[cfg(not(feature = "std"))]
extern "C" {
pub fn ext_clear_storage(key_data: *const u8, key_len: u32);
pub fn ext_keccak_256(data: *const u8, len: u32, out: *mut u8);
}

/// Make sure the old runtime interface needs to be imported.
#[no_mangle]
#[cfg(not(feature = "std"))]
pub fn force_old_runtime_interface_import() {
unsafe { ext_clear_storage(sp_std::ptr::null(), 0); }
unsafe { ext_keccak_256(sp_std::ptr::null(), 0, sp_std::ptr::null_mut()); }
Expand Down