File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ const COMMAND_DESCRIPTION = "FCF CLI tool."
1616const VERSION = packageJson ?. version || "v0.0.1" ;
1717const GITHUB_ISSUER = "https://token.actions.githubusercontent.com" ;
1818const REGISTER_WORKFLOW_PATH = ".github/workflows/fcf-register.yml" ;
19+ const DEFAULT_LIST_BLOCK_RANGE = 50_000n ;
1920const REGISTER_WORKFLOW = `name: Register Repository
2021
2122on:
@@ -193,9 +194,13 @@ program
193194 . command ( "list" )
194195 // needs to be removed in prod or be a default
195196 . requiredOption ( "--contract <addr>" , "deployed RIK address" )
196- . option ( "--from-block <n>" , "starting block" , "0" )
197+ . option ( "--from-block <n>" , "starting block" )
197198 . action ( async ( opts ) => {
198199 const { publicC } = clients ( ) ;
200+
201+ // by default looks only in the last DEFAULT_LIST_BLOCK_RANGE blocks
202+ if ( ! opts . fromBlock ) opts . fromBlock = await publicC . getBlockNumber ( ) - DEFAULT_LIST_BLOCK_RANGE ;
203+
199204 const logs = await publicC . getLogs ( {
200205 address : opts . contract as `0x${ string } ` ,
201206 event : RepoRegisteredEvent ,
You can’t perform that action at this time.
0 commit comments