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

contracts: Fix __unstable__ feature #8872

Merged
1 commit merged into from
May 20, 2021
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
8 changes: 4 additions & 4 deletions frame/contracts/src/wasm/env_def/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ macro_rules! gen_signature_dispatch {
( $ctx:ident $( , $names:ident : $params:ty )* ) $( -> $returns:ty )* , $($rest:tt)*
) => {
let module = stringify!($module).as_bytes();
#[cfg(not(feature = "unstable-interface"))]
if module == b"__unstable__" {
return false;
}
if module == $needle_module && stringify!($name).as_bytes() == $needle_name {
let signature = gen_signature!( ( $( $params ),* ) $( -> $returns )* );
if $needle_sig == &signature {
Expand Down Expand Up @@ -219,6 +215,10 @@ macro_rules! define_env {

impl $crate::wasm::env_def::ImportSatisfyCheck for $init_name {
fn can_satisfy(module: &[u8], name: &[u8], func_type: &parity_wasm::elements::FunctionType) -> bool {
#[cfg(not(feature = "unstable-interface"))]
if module == b"__unstable__" {
return false;
}
gen_signature_dispatch!(
module, name, func_type ;
$( $module, $name ( $ctx $(, $names : $params )* ) $( -> $returns )* , )*
Expand Down