Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Commit

Permalink
feat: add transactionTimestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
gjgd committed Aug 28, 2019
1 parent c760018 commit a8a5291
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/element-lib/src/sidetree/resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,19 @@ module.exports = async (sidetree) => {
|| item.operation.decodedOperationPayload.didUniqueSuffix === didUniqueSuffix,
);

// Attach transactionTimestamp to the transactionObject so that it can be used in the UI
items = await Promise.all(
items.map(async item => ({
...item,
transaction: {
...item.transaction,
transactionTimestamp: (await sidetree.blockchain.getBlockchainTime(
item.transaction.transactionTime,
)).timestamp,
},
})),
);

let updatedState;
if (Object.keys(cachedRecord).length === 0) {
updatedState = {};
Expand Down

0 comments on commit a8a5291

Please sign in to comment.