diff --git a/address.json b/address.json index a97b3da27..d40d4baff 100644 --- a/address.json +++ b/address.json @@ -17,6 +17,11 @@ "polkadot-airdrop.org": [ "14BFcanA3zYTpbCmzKGXVEnFe9WoBCq3JdPQdnsiEgEhXSA2" ], + "polkadot-event.com": [ + "124QZBBTZtPDGPS4GqK6w8y5rPUC7EydLka9Gk3qCTDemGTN", + "13DW6RWgjUPcZ9mwwEMcb8qBcakQyzpxNw8ic32QXAEfGLxW", + "15GhxqrycWiRe9PePtN5CppTk8g63dXgM5vm9a9gwRMbPjRZ" + ], "polkadot.center": [ "12nNSFLEJU2HiuSidgd3c1bzSNn82SNpobnGso5GXF43eme6", "12sGH82aAENExuio8BpNqXGxaXgrxMS88Qm9bfSJrav9Nito", diff --git a/packages/phishing/src/addrcheck.spec.ts b/packages/phishing/src/addrcheck.spec.ts index 76a31c05a..ac60e6d18 100644 --- a/packages/phishing/src/addrcheck.spec.ts +++ b/packages/phishing/src/addrcheck.spec.ts @@ -24,6 +24,33 @@ function delayLoop (): Promise { }); } +// shared between polkadot.center & polkadot-event.com (addresses are also the same on first run) +async function checkGetWallet (ours: Record, site: string): Promise { + const all = Object.values(ours).reduce((all: string[], addrs: string[]): string[] => { + all.push(...addrs); + + return all; + }, []); + const found: string[] = []; + + for (let i = 0; i < 25; i++) { + const result = await (await fetch(`https://${site}/get_wallet.php`)).json() as Record; + const wallet = result.wallet.replace('\r', ''); + + if (!found.includes(wallet)) { + found.push(wallet); + } + + await delayLoop(); + } + + console.log(site, JSON.stringify(found)); + + const missing = found.filter((a) => !all.includes(a)); + + assertAndLog(missing.length === 0, `Missing entries found for ${site}: ${JSON.stringify(missing)}`); +} + describe('addrcheck', (): void => { let ours: Record; @@ -33,23 +60,10 @@ describe('addrcheck', (): void => { }); it('has all entries from polkadot.center', async (): Promise => { - const found: string[] = []; + await checkGetWallet(ours, 'polkadot.center'); + }); - for (let i = 0; i < 25; i++) { - const result = await (await fetch('https://polkadot.center/get_wallet.php')).json() as Record; - const wallet = result.wallet.replace('\r', ''); - - if (!found.includes(wallet)) { - found.push(wallet); - } - - await delayLoop(); - } - - console.log('polkadot.center', JSON.stringify(found)); - - const missing = found.filter((a) => !ours['polkadot.center'].includes(a)); - - assertAndLog(missing.length === 0, `Missing entries found for polkadot.center: ${JSON.stringify(missing)}`); + it('has all entries from polkadot-event.com', async (): Promise => { + await checkGetWallet(ours, 'polkadot-event.com'); }); });