diff --git a/src/contracts/implementations/arbitrator/KlerosPOC.js b/src/contracts/implementations/arbitrator/KlerosPOC.js index 6db4cce..78019a6 100644 --- a/src/contracts/implementations/arbitrator/KlerosPOC.js +++ b/src/contracts/implementations/arbitrator/KlerosPOC.js @@ -683,7 +683,7 @@ class KlerosPOC extends ContractImplementation { netPNK += event.args._amount.toNumber() } - return netPNK + return this._Web3Wrapper.fromWei(netPNK, 'ether') } /** diff --git a/src/utils/StoreProviderWrapper.js b/src/utils/StoreProviderWrapper.js index 461c897..0629086 100644 --- a/src/utils/StoreProviderWrapper.js +++ b/src/utils/StoreProviderWrapper.js @@ -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 } }