Skip to content

Commit

Permalink
fix boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
ermalkaleci committed Oct 26, 2023
1 parent b08cfdb commit 41aa09d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/chopsticks/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ export const setupContext = async (argv: Config, overrideParent = false) => {
let blockData: BlockEntry | null = null
if (typeof argv.resume === 'string' && argv.resume.startsWith('0x')) {
blockData = await chain.db.queryBlock(argv.resume as HexString)
} else if (Number.isInteger(+argv.resume)) {
blockData = await chain.db.queryBlockByNumber(argv.resume as number)
} else if (argv.resume === 'true') {
} else if (typeof argv.resume === 'boolean' || argv.resume === 'true') {
blockData = await chain.db.queryHighestBlock()
} else if (Number.isInteger(+argv.resume)) {
blockData = await chain.db.queryBlockByNumber(+argv.resume)
} else {
throw new Error(`Resume failed. Invalid resume option ${argv.resume}`)
}
Expand Down

0 comments on commit 41aa09d

Please sign in to comment.