File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -721,9 +721,16 @@ pub fn process_shard_block(
721721 Ok ( deposit_receipts)
722722}
723723
724+ #[ derive( Debug , PartialEq , Serialize , Deserialize ) ]
725+ struct TestLibrary {
726+ name : String ,
727+ file : String ,
728+ }
729+
724730#[ derive( Debug , PartialEq , Serialize , Deserialize ) ]
725731struct TestBeaconState {
726732 execution_scripts : Vec < String > ,
733+ libraries : Vec < TestLibrary > ,
727734}
728735
729736#[ derive( Debug , PartialEq , Serialize , Deserialize ) ]
@@ -811,10 +818,19 @@ impl TryFrom<TestBeaconState> for BeaconState {
811818 } )
812819 } )
813820 . 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 ) ?,
828+ } )
829+ } )
830+ . collect ( ) ;
814831 Ok ( BeaconState {
815832 execution_scripts : scripts?,
816- // FIXME: add parser here
817- libraries : Vec :: new ( ) ,
833+ libraries : libraries?,
818834 } )
819835 }
820836}
You can’t perform that action at this time.
0 commit comments