Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/kleros.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ class Kleros {
// DISPUTES
this.disputes = new resources.Disputes(
this.arbitrator,
this.arbitrableContracts,
this.arbitrable,
this.storeWrapper
)
// NOTIFICATIONS
this.notifications = new resources.Notifications(
this.arbitrator,
this.arbitrableContracts,
this.arbitrable,
this.storeWrapper
)
}
Expand All @@ -85,7 +85,7 @@ class Kleros {
* @param {string} contractAddress - Address of arbitrable contract
*/
setArbitrableContractAddress = contractAddress => {
this.arbitrableContracts.setContractInstance(contractAddress)
this.arbitrable.setContractInstance(contractAddress)
}

/**
Expand Down Expand Up @@ -134,7 +134,7 @@ class Kleros {
this.storeWrapper = new StoreProviderWrapper(storeUri)

this.disputes.setStoreProviderInstance(this.storeWrapper)
this.arbitrableContract.setStoreProviderInstance(this.storeWrapper)
this.arbitrable.setStoreProviderInstance(this.storeWrapper)
this.arbitrator.setStoreProviderInstance(this.storeWrapper)
this.notifications.setStoreProviderInstance(this.storeWrapper)
}
Expand Down
34 changes: 34 additions & 0 deletions tests/integration/kleros.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import Web3 from 'web3'

import Kleros from '../../src/kleros'
import * as ethConstants from '../../src/constants/eth'

describe('Kleros', () => {
it('can be created', () => {
const mockStoreUri = ''
const ethProvider = new Web3.providers.HttpProvider(
ethConstants.LOCALHOST_ETH_PROVIDER
)
const mockArbitrator = '0x0'
const mockArbitrable = '0x1'

const klerosInstance = new Kleros(
ethProvider,
mockStoreUri,
mockArbitrator,
mockArbitrable
)

expect(klerosInstance.arbitrator).toBeTruthy()
expect(klerosInstance.arbitrable).toBeTruthy()
expect(klerosInstance.disputes).toBeTruthy()
expect(klerosInstance.notifications).toBeTruthy()

expect(klerosInstance.arbitrator.getContractAddress()).toEqual(
mockArbitrator
)
expect(klerosInstance.arbitrable.getContractAddress()).toEqual(
mockArbitrable
)
})
})