Skip to content
This repository was archived by the owner on Feb 21, 2024. It is now read-only.

Commit 81d63a8

Browse files
atheinazar-pc
authored andcommitted
The code generated by the interface macro did compare to the wrong module (paritytech#8872)
1 parent 4aa83c4 commit 81d63a8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

frame/contracts/src/wasm/env_def/macros.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ macro_rules! gen_signature_dispatch {
5151
( $ctx:ident $( , $names:ident : $params:ty )* ) $( -> $returns:ty )* , $($rest:tt)*
5252
) => {
5353
let module = stringify!($module).as_bytes();
54-
#[cfg(not(feature = "unstable-interface"))]
55-
if module == b"__unstable__" {
56-
return false;
57-
}
5854
if module == $needle_module && stringify!($name).as_bytes() == $needle_name {
5955
let signature = gen_signature!( ( $( $params ),* ) $( -> $returns )* );
6056
if $needle_sig == &signature {
@@ -219,6 +215,10 @@ macro_rules! define_env {
219215

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

0 commit comments

Comments
 (0)