-
Notifications
You must be signed in to change notification settings - Fork 14
Conversation
3613512
to
d7ffa1c
Compare
I removed the transpiled js from git. Seems like something unnecessary to track |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's ok. I added some comment to improve the code.
@@ -1 +1,2 @@ | |||
export const LOCALHOST_PROVIDER = 'http://localhost:8545' | |||
export const LOCALHOST_ETH_PROVIDER = 'http://localhost:8545' | |||
export const LOCALHOST_STORE_PROVIDER = 'http://localhost:3001' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can use kleros.in
by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
later we can use process.env
} | ||
|
||
getUserProfile = async (userAddress) => { | ||
let httpResponse = await this._makeRequest('GET', this._storeUri + '/' + userAddress) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you use template es6 ${}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use const
"description": "Kleros API", | ||
"main": "lib/kleros-api.js", | ||
"scripts": { | ||
"build": "webpack --env build", | ||
"dev": "webpack --progress --colors --watch --env dev", | ||
"test": "jest", | ||
"deploy": "yarn build && yarn deploy", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice command
|
||
getDocumentsForDispute = async (userAddress, hash) => { | ||
const userProfile = await this.getUserProfile(userAddress) | ||
if (!userProfile) throw new Error("No profile found for address: " + userAddress) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use single quote
return o.hash === hash | ||
}) | ||
|
||
if (disputeData.length < 1) return null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use lodash _.isEmpty()
if (httpResponse) { | ||
return JSON.parse(httpResponse) | ||
} else { | ||
return null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be more explicit
} | ||
|
||
newUserProfile = async (userAddress, contractsData = {}, disputesData = {}) => { | ||
let httpResponse = await this._makeRequest( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use const
@@ -41,10 +42,10 @@ class Kleros { | |||
storeProvider=null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add spaces
import {LOCALHOST_ETH_PROVIDER, LOCALHOST_STORE_PROVIDER} from '../constants' | ||
import config from '../config' | ||
|
||
const contractDataFake = [{"hash": "0x139963ddb98576ddd5f39c14b6cf2c12670b38a1", "contentDocument": '{"evidenceB": "<some byte string>"}'}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use single quotes
No description provided.