Skip to content

Commit d6678dc

Browse files
authored
Merge pull request #960 from oceanprotocol/feat/update-event
fix: update indexedMetadata event
2 parents 5fbd0fe + 88c7ed5 commit d6678dc

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/components/Indexer/processors/MetadataEventProcessor.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,14 @@ export class MetadataEventProcessor extends BaseEventProcessor {
219219

220220
const fieldsToUpdate = {
221221
indexedMetadata: {
222-
nft
223-
},
224-
event: {
225-
tx: event.transactionHash,
226-
from,
227-
contract: event.address,
228-
block,
229-
datetime
222+
nft,
223+
event: {
224+
txid: event.transactionHash,
225+
from,
226+
contract: event.address,
227+
block,
228+
datetime
229+
}
230230
}
231231
}
232232
ddoWithPricing.updateFields(fieldsToUpdate)

src/components/core/handler/ddoHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ export class FindDdoHandler extends CommandHandler {
555555
if (isResponseLegit) {
556556
const ddoInfo: FindDDOResponse = {
557557
id: ddo.id,
558-
lastUpdateTx: ddo.indexedMetadata.event.tx,
558+
lastUpdateTx: ddo.indexedMetadata.event.txid,
559559
lastUpdateTime: ddo.metadata.updated,
560560
provider: peer
561561
}
@@ -949,7 +949,7 @@ async function checkIfDDOResponseIsLegit(ddo: any): Promise<boolean> {
949949
}
950950

951951
// check events on logs
952-
const txId: string = indexedMetadata.event.tx // NOTE: DDO is txid, Asset is tx
952+
const txId: string = indexedMetadata.event.tx || indexedMetadata.event.txid // NOTE: DDO is txid, Asset is tx
953953
if (!txId) {
954954
CORE_LOGGER.error(`DDO event missing tx data, cannot confirm transaction`)
955955
return false

0 commit comments

Comments
 (0)