@@ -17,7 +17,6 @@ limitations under the License.
1717extern crate hyperlight_host;
1818use std:: thread:: { spawn, JoinHandle } ;
1919
20- use hyperlight_common:: flatbuffer_wrappers:: function_types:: { ParameterValue , ReturnType } ;
2120use hyperlight_host:: sandbox:: uninitialized:: UninitializedSandbox ;
2221use hyperlight_host:: sandbox_state:: sandbox:: EvolvableSandbox ;
2322use hyperlight_host:: sandbox_state:: transition:: Noop ;
@@ -65,12 +64,9 @@ fn do_hyperlight_stuff() {
6564
6665 // Call a guest function 5 times to generate some metrics.
6766 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 ( ) ;
7470 }
7571
7672 // Define a message to send to the guest.
@@ -79,12 +75,9 @@ fn do_hyperlight_stuff() {
7975
8076 // Call a guest function that calls the HostPrint host function 5 times to generate some metrics.
8177 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 ( ) ;
8881 }
8982 Ok ( ( ) )
9083 } ) ;
@@ -111,11 +104,8 @@ fn do_hyperlight_stuff() {
111104 for _ in 0 ..5 {
112105 let mut ctx = multiuse_sandbox. new_call_context ( ) ;
113106
114- let result = ctx. call ( "Spin" , ReturnType :: Void , None ) ;
115- assert ! ( result. is_err( ) ) ;
116- let result = ctx. finish ( ) ;
117- assert ! ( result. is_ok( ) ) ;
118- multiuse_sandbox = result. unwrap ( ) ;
107+ ctx. call :: < ( ) > ( "Spin" , ( ) ) . unwrap_err ( ) ;
108+ multiuse_sandbox = ctx. finish ( ) . unwrap ( ) ;
119109 }
120110
121111 for join_handle in join_handles {
0 commit comments