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

Commit

Permalink
fix: hotfixes 0.4.1 and 0.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
satello committed Jun 5, 2018
1 parent d19385d commit c6fdd3b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
36 changes: 31 additions & 5 deletions src/kleros.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 * //
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/resources/Notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down

0 comments on commit c6fdd3b

Please sign in to comment.