From 3fb9b4f82a10214d9cc464bf3861b9eea58d411b Mon Sep 17 00:00:00 2001 From: danielailie Date: Tue, 1 Oct 2024 14:48:40 +0300 Subject: [PATCH 1/2] Fix mark scam collection --- src/modules/scam/nft-scam.service.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/modules/scam/nft-scam.service.ts b/src/modules/scam/nft-scam.service.ts index 76723b7c9..319dcc0d1 100644 --- a/src/modules/scam/nft-scam.service.ts +++ b/src/modules/scam/nft-scam.service.ts @@ -26,7 +26,7 @@ export class NftScamService { private readonly pluginsService: PluginService, private readonly cacheEventsPublisher: CacheEventsPublisherService, private readonly logger: Logger, - ) {} + ) { } async validateNftScamInfoForIdentifier(identifier: string): Promise { const nft = await this.assetByIdentifierService.getAsset(identifier); @@ -246,12 +246,7 @@ export class NftScamService { const apiNfts = await this.mxApiService.getNftsByIdentifiers(nftsMissingFromDb?.map((x) => x.identifier)); if (!apiNfts) return; let mappedNfts: Asset[] = []; - if (scamInfo.type === ScamInfoTypeEnum.none) { - mappedNfts = apiNfts?.map((x) => new Asset({ ...Asset.fromNft(x), scamInfo })); - } else { - mappedNfts = apiNfts?.map((x) => Asset.fromNft(x)); - await this.pluginsService.computeScamInfo(mappedNfts); - } + mappedNfts = apiNfts?.map((x) => new Asset({ ...Asset.fromNft(x), scamInfo })); await this.updateBulkScamInfo(scamEngineVersion, mappedNfts); } From db6308cd34f7850bc2810b5a4cae1fad47be946c Mon Sep 17 00:00:00 2001 From: danielailie Date: Tue, 1 Oct 2024 14:56:11 +0300 Subject: [PATCH 2/2] merge declaration and initialization --- src/modules/scam/nft-scam.service.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/modules/scam/nft-scam.service.ts b/src/modules/scam/nft-scam.service.ts index 319dcc0d1..46c06ca67 100644 --- a/src/modules/scam/nft-scam.service.ts +++ b/src/modules/scam/nft-scam.service.ts @@ -245,8 +245,7 @@ export class NftScamService { const apiNfts = await this.mxApiService.getNftsByIdentifiers(nftsMissingFromDb?.map((x) => x.identifier)); if (!apiNfts) return; - let mappedNfts: Asset[] = []; - mappedNfts = apiNfts?.map((x) => new Asset({ ...Asset.fromNft(x), scamInfo })); + let mappedNfts: Asset[] = apiNfts?.map((x) => new Asset({ ...Asset.fromNft(x), scamInfo })); await this.updateBulkScamInfo(scamEngineVersion, mappedNfts); }