@@ -117,8 +117,8 @@ mod tests {
117117 #[ test]
118118 fn test_struct_api_generation ( ) {
119119 let mut val = Struct :: new ( "Foo" ) ;
120- val. add_field ( "bar" , & FixedSize :: bool ( ) ) ;
121- val. add_field ( "bar2" , & FixedSize :: bool ( ) ) ;
120+ val. add_field ( "bar" , & FixedSize :: bool ( ) ) . unwrap ( ) ;
121+ val. add_field ( "bar2" , & FixedSize :: bool ( ) ) . unwrap ( ) ;
122122 assert_eq ! (
123123 structs:: generate_new_fn( & val) . to_string( ) ,
124124 "function struct_Foo_new(bar, bar2) -> return_val { return_val := alloc(32) mstore(return_val, bar) let bar2_ptr := alloc(32) mstore(bar2_ptr, bar2) }" )
@@ -127,8 +127,8 @@ mod tests {
127127 #[ test]
128128 fn test_struct_getter_generation ( ) {
129129 let mut val = Struct :: new ( "Foo" ) ;
130- val. add_field ( "bar" , & FixedSize :: bool ( ) ) ;
131- val. add_field ( "bar2" , & FixedSize :: bool ( ) ) ;
130+ val. add_field ( "bar" , & FixedSize :: bool ( ) ) . unwrap ( ) ;
131+ val. add_field ( "bar2" , & FixedSize :: bool ( ) ) . unwrap ( ) ;
132132 assert_eq ! (
133133 structs:: generate_get_fn( & val, & val. get_field_names( ) . get( 0 ) . unwrap( ) ) . to_string( ) ,
134134 "function struct_Foo_get_bar_ptr(ptr) -> return_val { return_val := add(ptr, 31) }"
0 commit comments