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

Commit

Permalink
The code generated by the interface macro did compare to the wrong mo…
Browse files Browse the repository at this point in the history
…dule (paritytech#8872)
  • Loading branch information
athei authored and nazar-pc committed Aug 8, 2021
1 parent 4aa83c4 commit 81d63a8
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 81d63a8

Please sign in to comment.