File tree Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Original file line number Diff line number Diff line change 17
17
use super :: ContractEnvStorage ;
18
18
use crate :: {
19
19
env:: {
20
+ CallError ,
20
21
traits:: {
21
22
Env ,
22
23
EnvTypes ,
@@ -26,7 +27,7 @@ use crate::{
26
27
memory:: vec:: Vec ,
27
28
storage:: Key ,
28
29
} ;
29
- use scale:: Encode ;
30
+ use scale:: { Encode , Decode } ;
30
31
31
32
/// Stores the given value under the specified key in the contract storage.
32
33
///
84
85
{
85
86
T :: dispatch_raw_call ( & call. into ( ) . encode ( ) [ ..] )
86
87
}
88
+
89
+ /// Invokes a remote smart contract.
90
+ ///
91
+ /// Does not expect to receive return data back.
92
+ /// Use this whenever you call a remote smart contract that returns nothing back.
93
+ pub fn call_invoke < T > (
94
+ callee : T :: AccountId ,
95
+ gas : u64 ,
96
+ value : T :: Balance ,
97
+ input_data : & [ u8 ] ,
98
+ ) -> Result < ( ) , CallError >
99
+ where
100
+ T : Env ,
101
+ {
102
+ T :: call_invoke ( callee, gas, value, input_data)
103
+ }
104
+
105
+ /// Evaluates a remote smart contract.
106
+ ///
107
+ /// Expects to receive return data back.
108
+ /// Use this whenever calling a remote smart contract that returns a value.
109
+ pub fn call_evaluate < T , R > (
110
+ callee : T :: AccountId ,
111
+ gas : u64 ,
112
+ value : T :: Balance ,
113
+ input_data : & [ u8 ] ,
114
+ ) -> Result < R , CallError >
115
+ where
116
+ T : Env ,
117
+ R : Decode ,
118
+ {
119
+ T :: call_evaluate ( callee, gas, value, input_data)
120
+ }
You can’t perform that action at this time.
0 commit comments