import { assertExists } from '../../utils' ; import { RunHandlersOnBlock } from '../../utils/run.handlers.on.block' ; export type RunBlock = ( blockNumberOrHash : string ) => Promise < void > ; export function provideRunBlock ( runHandlersOnBlock ) { assertExists ( runHandlersOnBlock , 'runHandlersOnBlock' ) ; return async function runBlock ( blockNumberOrHash ) { let blocks = [ blockNumberOrHash ] ; if ( blockNumberOrHash . includes ( "," ) ) { blocks = blockNumberOrHash . split ( "," ) ; } for ( const block of blocks ) { await runHandlersOnBlock ( block ) ; } } ; }