Skip to content

Commit

Permalink
Stabilize "seal1" seal_call (paritytech#10366)
Browse files Browse the repository at this point in the history
  • Loading branch information
athei authored and ark0f committed Feb 27, 2023
1 parent 68e5f5d commit 0f979b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
9 changes: 3 additions & 6 deletions frame/contracts/src/wasm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,11 +541,10 @@ mod tests {
}

#[test]
#[cfg(feature = "unstable-interface")]
fn contract_call_forward_input() {
const CODE: &str = r#"
(module
(import "__unstable__" "seal_call" (func $seal_call (param i32 i32 i64 i32 i32 i32 i32 i32) (result i32)))
(import "seal1" "seal_call" (func $seal_call (param i32 i32 i64 i32 i32 i32 i32 i32) (result i32)))
(import "seal0" "seal_input" (func $seal_input (param i32 i32)))
(import "env" "memory" (memory 1 1))
(func (export "call")
Expand Down Expand Up @@ -596,11 +595,10 @@ mod tests {
}

#[test]
#[cfg(feature = "unstable-interface")]
fn contract_call_clone_input() {
const CODE: &str = r#"
(module
(import "__unstable__" "seal_call" (func $seal_call (param i32 i32 i64 i32 i32 i32 i32 i32) (result i32)))
(import "seal1" "seal_call" (func $seal_call (param i32 i32 i64 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)))
(import "env" "memory" (memory 1 1))
Expand Down Expand Up @@ -652,11 +650,10 @@ mod tests {
}

#[test]
#[cfg(feature = "unstable-interface")]
fn contract_call_tail_call() {
const CODE: &str = r#"
(module
(import "__unstable__" "seal_call" (func $seal_call (param i32 i32 i64 i32 i32 i32 i32 i32) (result i32)))
(import "seal1" "seal_call" (func $seal_call (param i32 i32 i64 i32 i32 i32 i32 i32) (result i32)))
(import "env" "memory" (memory 1 1))
(func (export "call")
(drop
Expand Down
4 changes: 2 additions & 2 deletions frame/contracts/src/wasm/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ define_env!(Env, <E: Ext>,
// `ReturnCode::BelowSubsistenceThreshold`
// `ReturnCode::TransferFailed`
// `ReturnCode::NotCallable`
[__unstable__] seal_call(
[seal1] seal_call(
ctx,
flags: u32,
callee_ptr: u32,
Expand All @@ -940,7 +940,7 @@ define_env!(Env, <E: Ext>,
output_len_ptr: u32
) -> ReturnCode => {
ctx.call(
CallFlags::from_bits(flags).ok_or_else(|| "used rerved bit in CallFlags")?,
CallFlags::from_bits(flags).ok_or_else(|| "used reserved bit in CallFlags")?,
callee_ptr,
gas,
value_ptr,
Expand Down

0 comments on commit 0f979b7

Please sign in to comment.