Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions frame/contracts/fixtures/chain_extension.wat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
;; Call chain extension by passing through input and output of this contract
(module
(import "seal0" "seal_call_chain_extension"
(func $seal_call_chain_extension (param i32 i32 i32 i32 i32) (result i32))
(import "seal0" "call_chain_extension"
(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_return" (func $seal_return (param i32 i32 i32)))
Expand Down Expand Up @@ -30,7 +30,7 @@
(call $seal_input (i32.const 4) (i32.const 0))

;; 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.const 4) ;; input_ptr
(i32.load (i32.const 0)) ;; input_len
Expand Down
4 changes: 2 additions & 2 deletions frame/contracts/src/wasm/prepare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ impl LoadedModule {
let _ = import.ty().func().ok_or("expected a function")?;

if !<T as Config>::ChainExtension::enabled() &&
import.name().as_bytes() == b"seal_call_chain_extension" ||
import.name().as_bytes() == b"call_chain_extension"
(import.name().as_bytes() == b"seal_call_chain_extension" ||
import.name().as_bytes() == b"call_chain_extension")
{
return Err("Module uses chain extensions but chain extensions are disabled")
}
Expand Down