From f37dcd749c987cfa167753f5cacf650a6d8f81c8 Mon Sep 17 00:00:00 2001 From: Redm4x <2829180+Redm4x@users.noreply.github.com> Date: Fri, 29 Nov 2024 15:01:29 -0500 Subject: [PATCH] fix(provider): fix indexing of provider attribute unsign txs --- .../indexer/src/indexers/akashStatsIndexer.ts | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/apps/indexer/src/indexers/akashStatsIndexer.ts b/apps/indexer/src/indexers/akashStatsIndexer.ts index ec0715b7a..d3b47720c 100644 --- a/apps/indexer/src/indexers/akashStatsIndexer.ts +++ b/apps/indexer/src/indexers/akashStatsIndexer.ts @@ -939,14 +939,24 @@ export class AkashStatsIndexer extends Indexer { height: number, blockGroupTransaction: DbTransaction ) { - await ProviderAttributeSignature.destroy({ - where: { - provider: decodedMessage.owner, - auditor: decodedMessage.auditor, - key: { [Op.in]: decodedMessage.keys } - }, - transaction: blockGroupTransaction - }); + if (decodedMessage.keys.length > 0) { + await ProviderAttributeSignature.destroy({ + where: { + provider: decodedMessage.owner, + auditor: decodedMessage.auditor, + key: { [Op.in]: decodedMessage.keys } + }, + transaction: blockGroupTransaction + }); + } else { + await ProviderAttributeSignature.destroy({ + where: { + provider: decodedMessage.owner, + auditor: decodedMessage.auditor + }, + transaction: blockGroupTransaction + }); + } } seed(): Promise {