From 35d4cef9eda52a33bb2137abadffca93cee39e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Thu, 20 May 2021 15:29:44 +0200 Subject: [PATCH] The code generated by the interface macro did compare to the wrong module --- frame/contracts/src/wasm/env_def/macros.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frame/contracts/src/wasm/env_def/macros.rs b/frame/contracts/src/wasm/env_def/macros.rs index a8127939c0189..fbaf7282140b2 100644 --- a/frame/contracts/src/wasm/env_def/macros.rs +++ b/frame/contracts/src/wasm/env_def/macros.rs @@ -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 { @@ -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 )* , )*