diff --git a/package.json b/package.json index 93b78d1..406ca22 100644 --- a/package.json +++ b/package.json @@ -82,9 +82,10 @@ "@kleros/archon": "^0.3.0", "@typeform/embed": "^0.5.12", "create-redux-form": "^0.1.2", + "eth-archon": "^0.2.0", "ethjs": "^0.3.3", "history": "^4.7.2", - "kleros-api": "^0.17.3", + "kleros-api-2": "^0.19.9", "lessdux": "^0.7.3", "normalize.css": "^7.0.0", "react": "^16.2.0", diff --git a/src/bootstrap/dapp-api.js b/src/bootstrap/dapp-api.js index b838063..a9c239b 100644 --- a/src/bootstrap/dapp-api.js +++ b/src/bootstrap/dapp-api.js @@ -1,5 +1,6 @@ import Eth from 'ethjs' -import { Kleros } from 'kleros-api' +import { Kleros } from 'kleros-api-2' // FIXME NPM hack +import Archon from '@kleros/archon' import * as ethConstants from '../constants/eth' @@ -31,6 +32,8 @@ const initializeKleros = async () => { kleros = new Kleros(eth.currentProvider, STORE_PROVIDER, ARBITRATOR_ADDRESS) } +const archon = new Archon(eth.currentProvider) + const ETHAddressRegExpCaptureGroup = '(0x[a-fA-F0-9]{40})' const ETHAddressRegExp = /0x[a-fA-F0-9]{40}/ const strictETHAddressRegExp = /^0x[a-fA-F0-9]{40}$/ @@ -44,7 +47,8 @@ export { ETHAddressRegExp, strictETHAddressRegExp, networkID, - env + env, + archon } setTimeout( diff --git a/src/components/iframes/doges-on-trial-evidence/index.js b/src/components/iframes/doges-on-trial-evidence/index.js index 8e18e14..b73f251 100644 --- a/src/components/iframes/doges-on-trial-evidence/index.js +++ b/src/components/iframes/doges-on-trial-evidence/index.js @@ -1,5 +1,5 @@ import React, { Component } from 'react' -import { ArbitrablePermissionList } from 'kleros-api/lib/contracts/implementations/arbitrable' +import { ArbitrablePermissionList } from 'kleros-api-2/lib/contracts/implementations/arbitrable' import { eth, env } from '../../../bootstrap/dapp-api' import LinkBox from '../../link-box' diff --git a/src/containers/dispute/components/details/index.js b/src/containers/dispute/components/details/index.js index 1776023..61d5463 100644 --- a/src/containers/dispute/components/details/index.js +++ b/src/containers/dispute/components/details/index.js @@ -1,13 +1,11 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import { ChainData } from '../../../../chainstrap' import { ARBITRATOR_ADDRESS } from '../../../../bootstrap/dapp-api' import { dateToString } from '../../../../utils/date' import { weiBNToDecimalString } from '../../../../utils/number' import LabelValueGroup from '../../../../components/label-value-group' import TruncatableTextBox from '../../../../components/truncatable-text-box' -import * as chainViewConstants from '../../../../constants/chain-view' import LinkBox from '../../../../components/link-box' import './details.css' @@ -24,12 +22,16 @@ class Details extends Component { message.data.target === 'evidence' && message.data.loaded ) { - const { metaEvidence, disputeID, arbitrableContractAddress } = this.props + const { + metaEvidenceJSON, + disputeID, + arbitrableContractAddress + } = this.props message.source.postMessage( { target: 'evidence', - metaEvidence, + metaEvidence: metaEvidenceJSON, evidence: null, arbitrableContractAddress, arbitratorAddress: ARBITRATOR_ADDRESS, @@ -42,28 +44,28 @@ class Details extends Component { render() { const { - date, + createdAt, arbitrationFee, - arbitrableContractAddress, - disputeID, appealNumber, - metaEvidence + metaEvidenceJSON } = this.props // Default display of primary document file. - let fileDisplay = ( + let fileDisplay = metaEvidenceJSON.fileURI ? (

File

- +
+ ) : ( +
) // Use external interface to display primary document file. - if (metaEvidence.evidenceDisplayInterfaceURL) + if (metaEvidenceJSON.evidenceDisplayInterfaceURL) fileDisplay = (