File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed
Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -728,7 +728,7 @@ struct TestLibrary {
728728#[ derive( Debug , PartialEq , Serialize , Deserialize ) ]
729729struct TestBeaconState {
730730 execution_scripts : Vec < String > ,
731- libraries : Vec < TestLibrary > ,
731+ libraries : Option < Vec < TestLibrary > > ,
732732}
733733
734734#[ derive( Debug , PartialEq , Serialize , Deserialize ) ]
@@ -816,16 +816,19 @@ impl TryFrom<TestBeaconState> for BeaconState {
816816 } )
817817 } )
818818 . collect ( ) ;
819- let libraries: Result < Vec < Library > , ScoutError > = input
820- . libraries
821- . iter ( )
822- . map ( |library| {
823- Ok ( Library {
824- name : library. name . to_string ( ) ,
825- code : std:: fs:: read ( & library. file ) ?,
819+ let libraries: Result < Vec < Library > , ScoutError > = if let Some ( libraries) = input. libraries {
820+ libraries
821+ . iter ( )
822+ . map ( |library| {
823+ Ok ( Library {
824+ name : library. name . to_string ( ) ,
825+ code : std:: fs:: read ( & library. file ) ?,
826+ } )
826827 } )
827- } )
828- . collect ( ) ;
828+ . collect ( )
829+ } else {
830+ Ok ( Vec :: new ( ) )
831+ } ;
829832 Ok ( BeaconState {
830833 execution_scripts : scripts?,
831834 libraries : libraries?,
You can’t perform that action at this time.
0 commit comments