package Ġio . nova foundation . nova Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . util . Log Ċ import Ġandroidx . test . core . app . Application Provider Ċ import Ġandroidx . test . ext . junit . runners . Android JUnit 4 Ċ import Ġio . nova foundation . nova . common . data . network . runtime . binding . bind Event Records Ċ import Ġio . nova foundation . nova . common . di . Feature Utils Ċ import Ġio . nova foundation . nova . common . utils . LOG _ TAG Ċ import Ġio . nova foundation . nova . common . utils . system Ċ import Ġio . nova foundation . nova . runtime . di . Runtime Api Ċ import Ġio . nova foundation . nova . runtime . di . Runtime Component Ċ import Ġio . nova foundation . nova . runtime . multi Network . connection . Chain Connection Ċ import Ġjp . co . sor am its u . fe ar less _ utils . runtime . metadata . storage Ċ import Ġjp . co . sor am its u . fe ar less _ utils . runtime . metadata . storage Key Ċ import Ġkotlinx . coroutines . run Blocking Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ Ċ @ RunWith ( Android JUnit 4 :: class ) Ċ class ĠBlock Parsing IntegrationTest Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġchain Genesis Ġ= Ġ" f 1 cf 9 0 2 2 c 7 ebb 3 4 b 1 6 2 d 5 b 5 e 3 4 e 7 0 5 a 5 a 7 4 0 b 2 d 0 ecc 1 0 0 9 fb 8 9 0 2 3 e 6 2 a 4 8 8 1 0 8 " Ġ// ĠSh iden ĊĊĠĠĠ Ġprivate Ġval Ġruntime Api Ġ= ĠFeature Utils . get Feature < Runtime Component >( ĊĠĠĠĠĠĠĠ ĠApplication Provider . getApplicationContext < Context >(), ĊĠĠĠĠĠĠĠ ĠRuntime Api :: class . java ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġprivate Ġval Ġchain Registry Ġ= Ġruntime Api . chain Registry () ĊĠĠĠ Ġprivate Ġval Ġexternal Requirement Flow Ġ= Ġruntime Api . external Requirement Flow () ĊĊĠĠĠ Ġprivate Ġval Ġrpc Calls Ġ= Ġruntime Api . rpc Calls () ĊĊĠĠĠ Ġprivate Ġval Ġremote Storage Ġ= Ġruntime Api . remote Storage Source () ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Block Parsing () Ġ= Ġrun Blocking Ġ{ ĊĠĠĠĠĠĠĠ Ġexternal Requirement Flow . emit ( Chain Connection . External Requirement . ALLOWED ) ĊĠĠĠĠĠĠĠ Ġval Ġchain Ġ= Ġchain Registry . get Chain ( chain Genesis ) ĊĊĠĠĠĠĠĠĠ Ġval Ġblock Ġ= Ġrpc Calls . getBlock ( chain . id ) ĊĊĠĠĠĠĠĠĠ Ġval Ġlog Tag Ġ= Ġthis @ Block Parsing IntegrationTest . LOG _ TAG ĊĊĠĠĠĠĠĠĠ ĠLog . d ( log Tag , Ġblock . block . header . number . toString ()) ĊĊĠĠĠĠĠĠĠ Ġval Ġevents Ġ= Ġremote Storage . query ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġchain Id Ġ= Ġchain . id , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġkey Builder Ġ= Ġ{ Ġit . metadata . system (). storage (" Events "). storage Key () Ġ}, ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbinding Ġ= Ġ{ Ġscale , Ġruntime Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠLog . d ( log Tag , Ġscale !! ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġbind Event Records ( scale , Ġruntime ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ) Ċ Ċ // ĠĠĠĠĠĠĠ Ġval Ġevents Raw Ġ= Ġ" 0 x 0 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 5 8 5 f 8 f 0 9 0 0 0 0 0 0 0 0 0 2 0 0 0 0 " Ċ // ĠĠĠĠĠĠĠ Ġval Ġtype Ġ= Ġbind Event Records ( events Raw , Ġchain Registry . get Runtime ( chain . id )) ĊĠĠĠ Ġ} Ċ } Ċ