File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
packages/cli/src/commands Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ export default class AddCommand extends Command {
8181
8282 if ( isLocalHost ) this . warn ( '`localhost` network detected, prompting user for inputs' ) ;
8383
84- let startBlock = startBlockFlag ;
84+ let startBlock = parseInt ( startBlockFlag ?? '' ) . toString ( ) ;
8585 let contractName = contractNameFlag ;
8686
8787 const entities = getEntities ( manifest ) ;
@@ -136,9 +136,7 @@ export default class AddCommand extends Command {
136136
137137 try {
138138 if ( isLocalHost ) throw Error ; // Triggers user prompting without waiting for Etherscan lookup to fail
139- if ( startBlock === undefined ) {
140- startBlock = Number ( await loadStartBlockForContract ( network , address ) ) . toString ( ) ;
141- }
139+ startBlock ||= Number ( await loadStartBlockForContract ( network , address ) ) . toString ( ) ;
142140 } catch ( error ) {
143141 // we cannot ask user to do prompt in test environment
144142 if ( process . env . NODE_ENV !== 'test' ) {
@@ -161,7 +159,6 @@ export default class AddCommand extends Command {
161159
162160 try {
163161 if ( isLocalHost ) throw Error ; // Triggers user prompting without waiting for Etherscan lookup to fail
164-
165162 contractName ||= await loadContractNameForAddress ( network , address ) ;
166163 } catch ( error ) {
167164 // not asking user to do prompt in test environment
You can’t perform that action at this time.
0 commit comments