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 @@ -730,7 +730,7 @@ struct TestLibrary {
730730#[ derive( Debug , PartialEq , Serialize , Deserialize ) ]
731731struct TestBeaconState {
732732 execution_scripts : Vec < String > ,
733- libraries : Vec < TestLibrary > ,
733+ libraries : Option < Vec < TestLibrary > > ,
734734}
735735
736736#[ derive( Debug , PartialEq , Serialize , Deserialize ) ]
@@ -818,16 +818,19 @@ impl TryFrom<TestBeaconState> for BeaconState {
818818 } )
819819 } )
820820 . collect ( ) ;
821- let libraries: Result < Vec < Library > , ScoutError > = input
822- . libraries
823- . iter ( )
824- . map ( |library| {
825- Ok ( Library {
826- name : library. name . to_string ( ) ,
827- code : std:: fs:: read ( & library. file ) ?,
821+ let libraries: Result < Vec < Library > , ScoutError > = if let Some ( libraries) = input. libraries {
822+ libraries
823+ . iter ( )
824+ . map ( |library| {
825+ Ok ( Library {
826+ name : library. name . to_string ( ) ,
827+ code : std:: fs:: read ( & library. file ) ?,
828+ } )
828829 } )
829- } )
830- . collect ( ) ;
830+ . collect ( )
831+ } else {
832+ Ok ( Vec :: new ( ) )
833+ } ;
831834 Ok ( BeaconState {
832835 execution_scripts : scripts?,
833836 libraries : libraries?,
You can’t perform that action at this time.
0 commit comments