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

Commit

Permalink
feat: normalize token units
Browse files Browse the repository at this point in the history
  • Loading branch information
epiqueras authored and satello committed Feb 15, 2018
1 parent b76e5e9 commit d0d40f8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/abstractWrappers/Notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class Notifications extends AbstractWrapper {
* Fetch all user notifications
* @param {string} account address of user
*/
getNoticiations = async (
getNotifications = async (
account
) => {
const profile = await this._StoreProvider.getUserProfile(account)
Expand Down
4 changes: 2 additions & 2 deletions src/contractWrappers/ArbitrableTransactionWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ class ArbitrableTransactionWrapper extends ContractWrapper {
status: status.toNumber(),
arbitratorExtraData,
disputeId: disputeId.toNumber(),
partyAFee: partyAFee.toNumber(),
partyBFee: partyBFee.toNumber(),
partyAFee: this._Web3Wrapper.fromWei(partyAFee.toNumber(), 'ether'),
partyBFee: this._Web3Wrapper.fromWei(partyBFee.toNumber(), 'ether'),
lastInteraction,
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/contractWrappers/KlerosWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class KlerosWrapper extends ContractWrapper {
try {
const arbitrationCost = await contractInstance.arbitrationCost(contractExtraData)

return arbitrationCost.toNumber()
return this._Web3Wrapper.fromWei(arbitrationCost.toNumber(), 'ether')
} catch (e) {
throw new Error(e)
}
Expand Down Expand Up @@ -380,7 +380,7 @@ class KlerosWrapper extends ContractWrapper {
numberOfAppeals: dispute[2].toNumber(),
rulingChoices: dispute[3].toNumber(),
initialNumberJurors: dispute[4].toNumber(),
arbitrationFeePerJuror: dispute[5].toNumber(),
arbitrationFeePerJuror: this._Web3Wrapper.fromWei(dispute[5].toNumber(), 'ether'),
state: dispute[6].toNumber(),
status: (await contractInstance.disputeStatus(disputeId)).toNumber()
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/kleros.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -585,15 +585,15 @@ describe('Kleros', () => {

expect(notifications.length).toBeTruthy()
// partyA got notifications
const allNotifications = await KlerosInstance.notifications.getNoticiations(partyA)
const allNotifications = await KlerosInstance.notifications.getNotifications(partyA)
expect(allNotifications.length).toBe(notifications.length)
let unreadNotification = await KlerosInstance.notifications.getUnreadNotifications(partyA)
expect(unreadNotification).toEqual(allNotifications)
await KlerosInstance.notifications.markNotificationAsRead(partyA, allNotifications[0].txHash, allNotifications[0].logIndex)
unreadNotification = await KlerosInstance.notifications.getUnreadNotifications(partyA)
expect(unreadNotification.length).toBe(notifications.length - 1)
// juror subscribed once drawn and got notifications
const jurorNotifications = await KlerosInstance.notifications.getNoticiations(juror)
const jurorNotifications = await KlerosInstance.notifications.getNotifications(juror)
expect(jurorNotifications.length).toEqual(4) // should have 1 notification for arbitration fee and 3 token redistribution notifications
// stop listening for new disputes
KlerosInstance.eventListener.stopWatchingArbitratorEvents(klerosCourt.address)
Expand Down

0 comments on commit d0d40f8

Please sign in to comment.