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
2 changes: 1 addition & 1 deletion src/contracts/implementations/arbitrator/KlerosPOC.js
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ class KlerosPOC extends ContractImplementation {
netPNK += event.args._amount.toNumber()
}

return netPNK
return this._Web3Wrapper.fromWei(netPNK, 'ether')
}

/**
Expand Down
27 changes: 9 additions & 18 deletions src/utils/StoreProviderWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,30 +433,21 @@ class StoreProviderWrapper {
logIndex,
isRead = true
) => {
const getBodyFn = async () => {
const userProfile = await this.newUserProfile(userAddress)

const notificationIndex = await _.findIndex(
userProfile.notifications,
notification =>
notification.txHash === txHash && notification.logIndex === logIndex
const getBodyFn = () =>
new Promise(resolve =>
resolve(
JSON.stringify({
logIndex,
isRead
})
)
)

if (_.isNull(notificationIndex))
throw new Error(errorConstants.NOTIFICATION_NOT_FOUND(txHash))

userProfile.notifications[notificationIndex].read = isRead
delete userProfile._id
delete userProfile.created_at
return JSON.stringify(userProfile)
}

const result = await this.queueWriteRequest(
getBodyFn,
'POST',
`${this._storeUri}/${userAddress}`
`${this._storeUri}/${userAddress}/notifications/${txHash}/read`
)

return result.body.notifications
}
}
Expand Down