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

Commit

Permalink
fix(contract): fix payArbitrationSeller Fee
Browse files Browse the repository at this point in the history
;skip
  • Loading branch information
n1c01a5 committed Sep 12, 2018
1 parent 203b3ca commit a848a2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,25 +174,22 @@ class MultipleArbitrableTransaction extends Arbitrable {
* Pay the arbitration fee to raise a dispute. To be called by the seller.
* @param {string} account Ethereum account.
* @param {number} arbitrableTransactionId - The index of the transaction.
* @param {number} arbitrationCost - Arbitration cost.
* @returns {object} - The result transaction object.
*/
payArbitrationFeeBySeller = async (
account,
arbitrableTransactionId
arbitrableTransactionId,
arbitrationCost
) => {
await this.loadContract()

const transactionArbitrableData0 = await this.getData(0)

try {
return this.contractInstance.payArbitrationFeeBySeller(
arbitrableTransactionId,
{
from: account,
value: this._Web3Wrapper.toWei(
transactionArbitrableData0.sellerFee,
'ether'
)
value: this._Web3Wrapper.toWei(arbitrationCost, 'ether')
}
)
} catch (err) {
Expand Down
5 changes: 2 additions & 3 deletions tests/integration/contracts.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ describe('Contracts', () => {
const raiseDisputeByBuyerTxObj = await ArbitrableTransactionInstance.payArbitrationFeeByBuyer(
arbitrableContractData.partyA,
0,
web3.fromWei(arbitrationCost)
web3.fromWei(arbitrationCost).toNumber()
)

expect(raiseDisputeByBuyerTxObj.tx).toEqual(
Expand All @@ -366,14 +366,13 @@ describe('Contracts', () => {
const raiseDisputeBySellerTxObj = await ArbitrableTransactionInstance.payArbitrationFeeBySeller(
arbitrableContractData.partyB,
0,
web3.fromWei(arbitrationCost)
web3.fromWei(arbitrationCost).toNumber()
)

expect(raiseDisputeBySellerTxObj.tx).toEqual(
expect.stringMatching(/^0x[a-f0-9]{64}$/)
) // tx hash


// ****** Juror side (pass period) ****** //

let newPeriod
Expand Down

0 comments on commit a848a2f

Please sign in to comment.