浏览代码

Adapt ink cross call test to new interface (#1139)

Cyrill Leutwiler 2 年之前
父节点
当前提交
76f0ffb447

+ 1 - 1
integration/substrate/ink/caller/Cargo.toml

@@ -5,7 +5,7 @@ authors = ["Cyrill Leutwiler <cyrill@parity.io>"]
 edition = "2021"
 
 [dependencies]
-ink = { version = "4.0.0-beta", default-features = false }
+ink = { version = "4.0.0-beta.1", default-features = false }
 
 scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
 scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }

+ 2 - 3
integration/substrate/ink/caller/lib.rs

@@ -30,7 +30,7 @@ mod caller {
             max_gas: Option<u64>,
             transfer_value: Option<u128>,
         ) -> u32 {
-            let my_return_value = build_call::<DefaultEnvironment>()
+            build_call::<DefaultEnvironment>()
                 .call_type(
                     Call::new()
                         .callee(callee)
@@ -39,8 +39,7 @@ mod caller {
                 .transferred_value(transfer_value.unwrap_or_default())
                 .exec_input(ExecutionInput::new(Selector::new(selector)).push_arg(arg))
                 .returns::<u32>() // FIXME: This should be Result<u32, u8> to respect LanguageError
-                .fire();
-            my_return_value.unwrap()
+                .invoke()
         }
     }
 }

+ 2 - 2
integration/substrate/inkee.sol

@@ -1,6 +1,6 @@
 contract Inkee {
     @selector([1, 2, 3, 4])
-    function echo(uint32 v) public pure returns (uint32) {
-        return v;
+    function echo(uint32 v) public pure returns (bool, uint32) {
+        return (false, v);
     }
 }