mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-19 18:05:41 +00:00
A subtle bug in the bool predicate for checking against chain extension imports prevents importing the non-prefixed version even if chain extension are enabled are enabled (#14642)
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
;; Call chain extension by passing through input and output of this contract
|
;; Call chain extension by passing through input and output of this contract
|
||||||
(module
|
(module
|
||||||
(import "seal0" "seal_call_chain_extension"
|
(import "seal0" "call_chain_extension"
|
||||||
(func $seal_call_chain_extension (param i32 i32 i32 i32 i32) (result i32))
|
(func $call_chain_extension (param i32 i32 i32 i32 i32) (result i32))
|
||||||
)
|
)
|
||||||
(import "seal0" "seal_input" (func $seal_input (param i32 i32)))
|
(import "seal0" "seal_input" (func $seal_input (param i32 i32)))
|
||||||
(import "seal0" "seal_return" (func $seal_return (param i32 i32 i32)))
|
(import "seal0" "seal_return" (func $seal_return (param i32 i32 i32)))
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
(call $seal_input (i32.const 4) (i32.const 0))
|
(call $seal_input (i32.const 4) (i32.const 0))
|
||||||
|
|
||||||
;; the chain extension passes through the input and returns it as output
|
;; the chain extension passes through the input and returns it as output
|
||||||
(call $seal_call_chain_extension
|
(call $call_chain_extension
|
||||||
(i32.load (i32.const 4)) ;; id
|
(i32.load (i32.const 4)) ;; id
|
||||||
(i32.const 4) ;; input_ptr
|
(i32.const 4) ;; input_ptr
|
||||||
(i32.load (i32.const 0)) ;; input_len
|
(i32.load (i32.const 0)) ;; input_len
|
||||||
|
|||||||
@@ -168,8 +168,8 @@ impl LoadedModule {
|
|||||||
let _ = import.ty().func().ok_or("expected a function")?;
|
let _ = import.ty().func().ok_or("expected a function")?;
|
||||||
|
|
||||||
if !<T as Config>::ChainExtension::enabled() &&
|
if !<T as Config>::ChainExtension::enabled() &&
|
||||||
import.name().as_bytes() == b"seal_call_chain_extension" ||
|
(import.name().as_bytes() == b"seal_call_chain_extension" ||
|
||||||
import.name().as_bytes() == b"call_chain_extension"
|
import.name().as_bytes() == b"call_chain_extension")
|
||||||
{
|
{
|
||||||
return Err("Module uses chain extensions but chain extensions are disabled")
|
return Err("Module uses chain extensions but chain extensions are disabled")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user