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

Commit

Permalink
fix: evidences -> evidence
Browse files Browse the repository at this point in the history
  • Loading branch information
satello committed Jun 5, 2018
1 parent 9c7b813 commit 60d00ea
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/contracts/abstractions/Arbitrable.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@ class ArbitrableContract extends AbstractContract {
)

const partyAEvidence = (partyAContractData
? partyAContractData.evidences
? partyAContractData.evidence
: []
).map(evidence => {
evidence.submitter = arbitrableContractData.partyA
return evidence
})
const partyBEvidence = (partyBContractData
? partyBContractData.evidences
? partyBContractData.evidence
: []
).map(evidence => {
evidence.submitter = arbitrableContractData.partyB
Expand Down
10 changes: 7 additions & 3 deletions src/resources/Disputes.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,17 @@ class Disputes {
// **************************** //
/**
* Fetch the shared dispute data from the store.
* @param {string} account - The users account.
* @param {string} disputeId - The index of the dispute.
* @returns {Promise} The dispute data in the store.
*/
getDisputeFromStore = disputeId => {
getDisputeFromStore = (account, disputeId) => {
const arbitratorAddress = this._ArbitratorInstance.getContractAddress()

return this._StoreProviderInstance.getDispute(arbitratorAddress, disputeId)
return this._StoreProviderInstance.getDispute(
account,
arbitratorAddress,
disputeId
)
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/disputeResolution.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ describe('Dispute Resolution', () => {
expect(web3.eth.getBalance(partyA).toNumber()).toEqual(partyABalance)
}

const netPNK = await KlerosPOCInstance.getNetTokensForDispute(0, partyA)
// const netPNK = await KlerosPOCInstance.getNetTokensForDispute(0, partyA)

const updatedContractData = await ArbitrableTransactionInstance.getData()
expect(parseInt(updatedContractData.status, 10)).toEqual(4)
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/contracts/abstractions/Arbitrable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ describe('ArbitrableContract', async () => {
const mockGetContractByAddress = jest.fn()
// return partyA then partyB contract
mockGetContractByAddress.mockReturnValueOnce({
evidences: [
evidence: [
{
name: 'testPartyA'
}
]
})
mockGetContractByAddress.mockReturnValueOnce({
evidences: [
evidence: [
{
name: 'testPartyB'
}
Expand Down Expand Up @@ -70,7 +70,7 @@ describe('ArbitrableContract', async () => {
const mockGetContractByAddress = jest.fn()
// return partyA then partyB contract
mockGetContractByAddress.mockReturnValueOnce({
evidences: [
evidence: [
{
name: 'testPartyA'
}
Expand Down
24 changes: 16 additions & 8 deletions tests/unit/resources/Disputes.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,12 @@ describe('Disputes', () => {
currentRulingForDispute: jest.fn().mockReturnValue(0),
canRuleDispute: jest.fn().mockReturnValue(false),
getContractAddress: jest.fn().mockReturnValue(arbitratorAddress),
getDisputeCreationEvent: jest.fn().mockReturnValue({blockNumber: 1}),
getDisputeCreationEvent: jest.fn().mockReturnValue({ blockNumber: 1 }),
getNetTokensForDispute: jest.fn().mockReturnValue(0),
getAppealRuledAtTimestamps: jest.fn().mockReturnValue(appealRuledAt),
getDisputeDeadlineTimestamps: jest.fn().mockReturnValue(appealDeadlines),
getDisputeDeadlineTimestamps: jest
.fn()
.mockReturnValue(appealDeadlines),
getAppealCreationTimestamps: jest.fn().mockReturnValue(appealCreatedAt)
}
disputesInstance._ArbitratorInstance = mockArbitrator
Expand Down Expand Up @@ -161,10 +163,12 @@ describe('Disputes', () => {
currentRulingForDispute: jest.fn().mockReturnValue(2),
canRuleDispute: jest.fn().mockReturnValue(true),
getContractAddress: jest.fn().mockReturnValue(arbitratorAddress),
getDisputeCreationEvent: jest.fn().mockReturnValue({blockNumber: 1}),
getDisputeCreationEvent: jest.fn().mockReturnValue({ blockNumber: 1 }),
getNetTokensForDispute: jest.fn().mockReturnValue(0),
getAppealRuledAtTimestamps: jest.fn().mockReturnValue(appealRuledAt),
getDisputeDeadlineTimestamps: jest.fn().mockReturnValue(appealDeadlines),
getDisputeDeadlineTimestamps: jest
.fn()
.mockReturnValue(appealDeadlines),
getAppealCreationTimestamps: jest.fn().mockReturnValue(appealCreatedAt)
}
disputesInstance._ArbitratorInstance = mockArbitrator
Expand Down Expand Up @@ -274,10 +278,12 @@ describe('Disputes', () => {
currentRulingForDispute: jest.fn().mockReturnValue(2),
canRuleDispute: jest.fn().mockReturnValue(false),
getContractAddress: jest.fn().mockReturnValue(arbitratorAddress),
getDisputeCreationEvent: jest.fn().mockReturnValue({blockNumber: 1}),
getDisputeCreationEvent: jest.fn().mockReturnValue({ blockNumber: 1 }),
getNetTokensForDispute: jest.fn().mockReturnValue(0),
getAppealRuledAtTimestamps: jest.fn().mockReturnValue(appealRuledAt),
getDisputeDeadlineTimestamps: jest.fn().mockReturnValue(appealDeadlines),
getDisputeDeadlineTimestamps: jest
.fn()
.mockReturnValue(appealDeadlines),
getAppealCreationTimestamps: jest.fn().mockReturnValue(appealCreatedAt)
}
disputesInstance._ArbitratorInstance = mockArbitrator
Expand Down Expand Up @@ -389,10 +395,12 @@ describe('Disputes', () => {
currentRulingForDispute: jest.fn().mockReturnValue(2),
canRuleDispute: jest.fn().mockReturnValue(false),
getContractAddress: jest.fn().mockReturnValue(arbitratorAddress),
getDisputeCreationEvent: jest.fn().mockReturnValue({blockNumber: 1}),
getDisputeCreationEvent: jest.fn().mockReturnValue({ blockNumber: 1 }),
getNetTokensForDispute: jest.fn().mockReturnValue(0),
getAppealRuledAtTimestamps: jest.fn().mockReturnValue(appealRuledAt),
getDisputeDeadlineTimestamps: jest.fn().mockReturnValue(appealDeadlines),
getDisputeDeadlineTimestamps: jest
.fn()
.mockReturnValue(appealDeadlines),
getAppealCreationTimestamps: jest.fn().mockReturnValue(appealCreatedAt)
}
disputesInstance._ArbitratorInstance = mockArbitrator
Expand Down

0 comments on commit 60d00ea

Please sign in to comment.