Skip to content

Commit

Permalink
fix: missing dispute check before execution
Browse files Browse the repository at this point in the history
  • Loading branch information
eccentricexit committed Jul 17, 2020
1 parent 83c900b commit d97f240
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,10 @@ const deploymentBlock = Number(process.env.FACTORY_BLOCK_NUM) || 0
const tcr = new ethers.Contract(tcrAddress, _GeneralizedTCR.abi, signer)
const { numberOfRequests } = await tcr.getItemInfo(itemID)
const requestID = numberOfRequests.toNumber() - 1
const { resolved } = await tcr.getRequestInfo(itemID, requestID)
console.info(`Resolved: ${resolved}`)
const { resolved, disputed } = await tcr.getRequestInfo(itemID, requestID)
console.info(`Disputed: ${disputed} Resolved: ${resolved}`)

if (!resolved) {
if (!disputed && !resolved) {
console.info('Executing it...')
try {
await tcr.executeRequest(itemID)
Expand Down

0 comments on commit d97f240

Please sign in to comment.