Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
feat(disputes): return deadline as epoch in ms instead of a date object
Browse files Browse the repository at this point in the history
  • Loading branch information
epiqueras authored and satello committed Feb 14, 2018
1 parent 32db45c commit 90d4856
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/abstractWrappers/Disputes.js
Expand Up @@ -332,7 +332,7 @@ class Disputes extends AbstractWrapper {
const arbitratorData = await this._Arbitrator.getData(arbitratorAddress)

// Last period change + current period duration = deadline
return new Date(1000 * (arbitratorData.lastPeriodChange + (await this._Arbitrator.getTimeForPeriod(arbitratorAddress, period))))
return 1000 * (arbitratorData.lastPeriodChange + (await this._Arbitrator.getTimeForPeriod(arbitratorAddress, period)))
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/test/kleros.test.js
Expand Up @@ -498,7 +498,7 @@ describe('Kleros', () => {

const disputesForJuror = await KlerosInstance.disputes.getDisputesForUser(klerosCourt.address, juror)
expect(disputesForJuror.length).toEqual(1)
expect(disputesForJuror[0].deadline.getTime()).toBe(1000 * (newState.lastPeriodChange + (await klerosPOCInstance.timePerPeriod(newState.period)).toNumber()))
expect(disputesForJuror[0].deadline).toBe(1000 * (newState.lastPeriodChange + (await klerosPOCInstance.timePerPeriod(newState.period)).toNumber()))
expect(disputesForJuror[0].arbitrableContractAddress).toEqual(contractArbitrableTransactionData.address)
expect(disputesForJuror[0].votes).toEqual([1,2,3])

Expand Down

0 comments on commit 90d4856

Please sign in to comment.