Skip to content
Permalink
Browse files

feat(disputes): submittedAt timestamp for evidence

  • Loading branch information...
satello authored and epiqueras committed Feb 27, 2018
1 parent 8e9cafa commit 3656d335a19da60e82381d322b69994d1447400e
Showing with 9 additions and 7 deletions.
  1. +1 −1 README.md
  2. +1 −1 src/constants/eth.js
  3. +6 −4 src/utils/StoreProviderWrapper.js
  4. +1 −1 tests/kleros.test.js
@@ -3,8 +3,8 @@
</p>

<p align="center">
<a href="https://badge.fury.io/js/kleros-api"><img src="https://badge.fury.io/js/kleros-api.svg" alt="NPM Version"></a>
<a href="https://travis-ci.org/kleros/kleros-api"><img src="https://travis-ci.org/kleros/kleros-api.svg?branch=master" alt="Build Status"></a>
<a href="https://badge.fury.io/js/kleros-api"><img src="https://badge.fury.io/js/kleros-api.svg" alt="npm version" height="18"></a>
<a href="https://coveralls.io/github/kleros/kleros-api?branch=master"><img src="https://coveralls.io/repos/github/kleros/kleros-api/badge.svg?branch=master" alt="Coverage Status"></a>
<a href="https://david-dm.org/kleros/kleros-api"><img src="https://david-dm.org/kleros/kleros-api.svg" alt="Dependencies"></a>
<a href="https://david-dm.org/kleros/kleros-api?type=dev"><img src="https://david-dm.org/kleros/kleros-api/dev-status.svg" alt="Dev Dependencies"></a>
@@ -1,5 +1,5 @@
export const LOCALHOST_ETH_PROVIDER = 'http://localhost:8545'
export const LOCALHOST_STORE_PROVIDER = 'http://localhost:3001'
export const LOCALHOST_STORE_PROVIDER = 'https://kleros.in'

export const NULL_ADDRESS = '0x'

@@ -21,9 +21,8 @@ class StoreProviderWrapper {
let body = null
try {
body = JSON.parse(httpRequest.responseText)
} catch (err) {
console.log(err)
}
// eslint-disable-next-line no-unused-vars
} catch (err) {}
resolve({
body: body,
status: httpRequest.status
@@ -153,13 +152,16 @@ class StoreProviderWrapper {
}

addEvidenceContract = async (address, account, name, description, url) => {
// get timestamp for submission
const submittedAt = new Date().getTime()
const httpResponse = await this._makeRequest(
'POST',
`${this._storeUri}/${account}/contracts/${address}/evidence`,
JSON.stringify({
name,
description,
url
url,
submittedAt
})
)

@@ -537,7 +537,6 @@ describe('Kleros', () => {
expect(resolutionOptions.length).toEqual(2)

// add an evidence for partyA
// FIXME use arbitrableTransaction
const testName = 'test name'
const testDesc = 'test description'
const testURL = 'http://test.com'
@@ -563,6 +562,7 @@ describe('Kleros', () => {
)

expect(contractStoreData.evidences[0].url).toBe(testURL)
expect(contractStoreData.evidences[0].submittedAt).toBeTruthy()

// check initial state of contract
// FIXME var must be more explicit

0 comments on commit 3656d33

Please sign in to comment.
You can’t perform that action at this time.