@@ -26,20 +26,19 @@ export async function createMirrorPlan({
2626 world : Address ;
2727 client : Client ;
2828 indexer : string ;
29+ blockscout : string ;
2930 } ;
3031} ) {
3132 const fromChainId = await getChainId ( from . client ) ;
3233
3334 const planFilename = path . join ( rootDir , mirrorPlansDirectory , `${ fromChainId } _${ from . world . toLowerCase ( ) } .ndjson.gz` ) ;
34- return planFilename ;
3535 await mkdir ( path . dirname ( planFilename ) , { recursive : true } ) ;
3636
3737 const plan = createPlanWriter ( planFilename ) ;
3838
3939 const makePlan = ( async ( ) => {
40- plan . write ( { step : "mirror" , chainId : fromChainId , worldAddress : from . world } ) ;
41-
4240 const worldDeploy = await getWorldDeploy ( from . client , from . world , from . block ) ;
41+
4342 console . log ( "getting systems" ) ;
4443 const systems = await getSystems ( {
4544 client : from . client ,
@@ -51,7 +50,13 @@ export async function createMirrorPlan({
5150 console . log ( "getting bytecode for" , systems . length , "systems" ) ;
5251 const systemsWithBytecode = await Promise . all (
5352 systems . map ( async ( system ) => {
54- const bytecode = await getDeployedBytecode ( { client : from . client , address : system . address } ) ;
53+ const bytecode = await getDeployedBytecode ( {
54+ client : from . client ,
55+ address : system . address ,
56+ debugLabel : `${ resourceToLabel ( system ) } system` ,
57+ allowedStorage : [ "empty" , { worldConsumer : worldDeploy . address } ] ,
58+ blockscoutUrl : from . blockscout ,
59+ } ) ;
5560 return { system, bytecode } ;
5661 } ) ,
5762 ) ;
@@ -70,7 +75,6 @@ export async function createMirrorPlan({
7075 // TODO: sort tables so that the insert order is correct (e.g. namespaces first)
7176
7277 let count = 0 ;
73- plan . write ( { step : "start:setRecords" } ) ;
7478 for ( const table of tables ) {
7579 const logs = await pRetry ( ( ) =>
7680 getRecordsAsLogs < Table > ( {
@@ -87,7 +91,6 @@ export async function createMirrorPlan({
8791 }
8892 count += logs . length ;
8993 }
90- plan . write ( { step : "end:setRecords" } ) ;
9194 console . log ( "got" , count , "total record logs" ) ;
9295 } ) ( ) ;
9396
0 commit comments