@@ -17,7 +17,6 @@ limitations under the License.
17
17
extern crate hyperlight_host;
18
18
use std:: thread:: { spawn, JoinHandle } ;
19
19
20
- use hyperlight_common:: flatbuffer_wrappers:: function_types:: { ParameterValue , ReturnType } ;
21
20
use hyperlight_host:: sandbox:: uninitialized:: UninitializedSandbox ;
22
21
use hyperlight_host:: sandbox_state:: sandbox:: EvolvableSandbox ;
23
22
use hyperlight_host:: sandbox_state:: transition:: Noop ;
@@ -65,12 +64,9 @@ fn do_hyperlight_stuff() {
65
64
66
65
// Call a guest function 5 times to generate some metrics.
67
66
for _ in 0 ..5 {
68
- let result = multiuse_sandbox. call_guest_function_by_name (
69
- "Echo" ,
70
- ReturnType :: String ,
71
- Some ( vec ! [ ParameterValue :: String ( "a" . to_string( ) ) ] ) ,
72
- ) ;
73
- assert ! ( result. is_ok( ) ) ;
67
+ multiuse_sandbox
68
+ . call_guest_function_by_name :: < String > ( "Echo" , "a" . to_string ( ) )
69
+ . unwrap ( ) ;
74
70
}
75
71
76
72
// Define a message to send to the guest.
@@ -79,12 +75,9 @@ fn do_hyperlight_stuff() {
79
75
80
76
// Call a guest function that calls the HostPrint host function 5 times to generate some metrics.
81
77
for _ in 0 ..5 {
82
- let result = multiuse_sandbox. call_guest_function_by_name (
83
- "PrintOutput" ,
84
- ReturnType :: Int ,
85
- Some ( vec ! [ ParameterValue :: String ( msg. clone( ) ) ] ) ,
86
- ) ;
87
- assert ! ( result. is_ok( ) ) ;
78
+ multiuse_sandbox
79
+ . call_guest_function_by_name :: < i32 > ( "PrintOutput" , msg. clone ( ) )
80
+ . unwrap ( ) ;
88
81
}
89
82
Ok ( ( ) )
90
83
} ) ;
@@ -108,11 +101,8 @@ fn do_hyperlight_stuff() {
108
101
for _ in 0 ..5 {
109
102
let mut ctx = multiuse_sandbox. new_call_context ( ) ;
110
103
111
- let result = ctx. call ( "Spin" , ReturnType :: Void , None ) ;
112
- assert ! ( result. is_err( ) ) ;
113
- let result = ctx. finish ( ) ;
114
- assert ! ( result. is_ok( ) ) ;
115
- multiuse_sandbox = result. unwrap ( ) ;
104
+ ctx. call :: < ( ) > ( "Spin" , ( ) ) . unwrap_err ( ) ;
105
+ multiuse_sandbox = ctx. finish ( ) . unwrap ( ) ;
116
106
}
117
107
118
108
for join_handle in join_handles {
0 commit comments