Skip to content
Permalink
Browse files

fix: hotfixes 0.4.1 and 0.4.2

  • Loading branch information...
satello committed Jun 1, 2018
1 parent d19385d commit c6fdd3baec1d68c3060dc375413115a2cd959110
Showing with 32 additions and 6 deletions.
  1. +31 −5 src/kleros.js
  2. +1 −1 src/resources/Notifications.js
@@ -42,7 +42,14 @@ class Kleros {
arbitrableContractAddress,
authToken
) {
// NOTE we default to KlerosPOC and ArbitrableTransaction
/**
* We need a set of implementations that we expose to the outside api and a set we use
* internally. This is because the implementation class itself sets the contract instance
* and we don't want race conditions between external and internal calls.
*
* FIXME this is an ugly way of doing this and still has some race conditions. See issue #138.
*/
// EXTERNAL
const _klerosPOC = new contracts.implementations.arbitrator.KlerosPOC(
ethereumProvider,
arbitratorAddress
@@ -51,6 +58,15 @@ class Kleros {
ethereumProvider,
arbitrableContractAddress
)
// INTERNAL
const _klerosPOCInternal = new contracts.implementations.arbitrator.KlerosPOC(
ethereumProvider,
arbitratorAddress
)
const _arbitrableTransactionInternal = new contracts.implementations.arbitrable.ArbitrableTransaction(
ethereumProvider,
arbitrableContractAddress
)

// **************************** //
// * INITIALIZED CLASSES * //
@@ -68,16 +84,26 @@ class Kleros {
_arbitrableTransaction,
this.storeWrapper
)

// Create new instance of arbitator and arbitrable for behind the scene task runners to use
const _arbitrator = new contracts.abstractions.Arbitrator(
_klerosPOCInternal,
this.storeWrapper
)
const _arbitrable = new contracts.abstractions.Arbitrable(
_arbitrableTransactionInternal,
this.storeWrapper
)
// DISPUTES
this.disputes = new resources.Disputes(
this.arbitrator,
this.arbitrable,
_arbitrator,
_arbitrable,
this.storeWrapper
)
// NOTIFICATIONS
this.notifications = new resources.Notifications(
this.arbitrator,
this.arbitrable,
_arbitrator,
_arbitrable,
this.storeWrapper
)
// AUTH
@@ -344,7 +344,7 @@ class Notifications {
// load arbitrable contract
await this._ArbitrableInstance.setContractInstance(event.args._arbitrable)

const arbitrableData = this._ArbitrableInstance.getData()
const arbitrableData = await this._ArbitrableInstance.getData()

if (
arbitrableData.partyA === account ||

0 comments on commit c6fdd3b

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