From 2dfead05362c0e8c723d6e22c6f47452b5db2e2d Mon Sep 17 00:00:00 2001 From: Jaco Date: Thu, 15 Apr 2021 10:43:43 +0300 Subject: [PATCH] Adjust addrecheck against all.json directly (#260) --- packages/phishing/src/addrcheck.spec.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/phishing/src/addrcheck.spec.ts b/packages/phishing/src/addrcheck.spec.ts index a00a2889f..402c3be4b 100644 --- a/packages/phishing/src/addrcheck.spec.ts +++ b/packages/phishing/src/addrcheck.spec.ts @@ -5,8 +5,8 @@ import fs from 'fs'; import { decodeAddress } from '@polkadot/util-crypto'; +import ourAddrList from '../../../address.json'; import { fetchWithTimeout } from './fetch'; -import { retrieveAddrList } from '.'; const TICKS = '```'; @@ -93,7 +93,10 @@ function checkAll (): Promise<[string, string[]][]> { 'https://polkadots.network/block.html', 'https://polkadot-gift.org/block.html' ].map((u) => checkTag(u, 'p', 'id="trnsctin"')), - checkTag('https://polkadot.activebonus.live/claim/', 'span', 'id="trnsctin"'), + ...[ + 'https://polkagiveaway.com/verification/index.html', + 'https://polkadot.activebonus.live/claim/' + ].map((u) => checkTag(u, 'span', 'id="trnsctin"')), ...[ 'https://claimpolka.com/claim/index.html', 'https://claimpolka.live/claim/index.html', @@ -141,14 +144,11 @@ function checkAll (): Promise<[string, string[]][]> { describe('addrcheck', (): void => { beforeAll((): void => { - jest.setTimeout(5 * 60 * 1000); + jest.setTimeout(2 * 60 * 1000); }); it('has all known addresses', async (): Promise => { - const [ours, _results] = await Promise.all([ - retrieveAddrList(), - checkAll() - ]); + const _results = await checkAll(); const results = _results.map(([url, addrs]): [string, string[]] => { return [url, addrs.filter((a) => { try { @@ -160,7 +160,7 @@ describe('addrcheck', (): void => { } })]; }); - const all = Object.values(ours).reduce((all: string[], addrs: string[]): string[] => { + const all = Object.values(ourAddrList).reduce((all: string[], addrs: string[]): string[] => { all.push(...addrs); return all;