mirror of
https://github.com/pezkuwichain/phishing.git
synced 2026-06-12 14:41:02 +00:00
Bump deps (#3029)
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
"version": "0.19.4-23-x",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@babel/runtime": "^7.21.0",
|
||||
"@polkadot/util": "^10.4.2",
|
||||
"@polkadot/util-crypto": "^10.4.2",
|
||||
"@polkadot/x-fetch": "^10.4.2"
|
||||
|
||||
@@ -158,11 +158,18 @@ function checkAll (): Promise<[string, string[]][]> {
|
||||
}
|
||||
|
||||
describe('addrcheck', (): void => {
|
||||
beforeAll((): void => {
|
||||
jest.setTimeout(2 * 60 * 1000);
|
||||
let counter = 0;
|
||||
let errors = 0;
|
||||
|
||||
afterEach((): void => {
|
||||
if (++counter === 1) {
|
||||
process.exit(errors);
|
||||
}
|
||||
});
|
||||
|
||||
it('has all known addresses', async (): Promise<void> => {
|
||||
errors++;
|
||||
|
||||
const _results = await checkAll();
|
||||
const results = _results.map(([url, addrs]): [string, string[]] => {
|
||||
return [url, addrs.filter((a) => {
|
||||
@@ -198,5 +205,7 @@ describe('addrcheck', (): void => {
|
||||
sites.length && process.env.CI_LOG && fs.appendFileSync('./.github/addrcheck.md', `\n\n${sites.length} urls with missing entries found at ${new Date().toUTCString()}:\n\n${TICKS}\n${JSON.stringify(mapMiss, null, 2)}\n${TICKS}\n`);
|
||||
|
||||
expect(sites).toEqual([]);
|
||||
|
||||
errors--;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
import fs from 'fs';
|
||||
import { load as yamlParse } from 'js-yaml';
|
||||
import process from 'process';
|
||||
|
||||
import { fetchJson, fetchText } from './fetch';
|
||||
|
||||
@@ -50,12 +51,18 @@ const ETHPHISH = 'https://raw.githubusercontent.com/MetaMask/eth-phishing-detect
|
||||
|
||||
describe('crosscheck', (): void => {
|
||||
const ours: string[] = ourSiteList.deny;
|
||||
let counter = 0;
|
||||
let errors = 0;
|
||||
|
||||
beforeAll((): void => {
|
||||
jest.setTimeout(120000);
|
||||
afterEach((): void => {
|
||||
if (++counter === 2) {
|
||||
process.exit(errors);
|
||||
}
|
||||
});
|
||||
|
||||
it('has all the relevant entries from CryptoScamDb', async (): Promise<void> => {
|
||||
errors++;
|
||||
|
||||
const raw = await fetchText(CRYPTODB);
|
||||
|
||||
// this is a hack, the text slipped in upstream
|
||||
@@ -69,9 +76,13 @@ describe('crosscheck', (): void => {
|
||||
console.log('CryptoScamDb missing\n', JSON.stringify(missing, null, 2));
|
||||
|
||||
assertAndLog(missing.length === 0, 'CryptoScamDB', missing);
|
||||
|
||||
errors--;
|
||||
});
|
||||
|
||||
it('has polkadot/kusama entries from eth-phishing-detect', async (): Promise<void> => {
|
||||
errors++;
|
||||
|
||||
const ethDb = await fetchJson<EthPhishing>(ETHPHISH);
|
||||
const filtered = ethDb.blacklist.filter((url) => matchName(url));
|
||||
const missing = filtered.filter((url) => !ours.includes(url));
|
||||
@@ -80,5 +91,7 @@ describe('crosscheck', (): void => {
|
||||
console.log('eth-phishing-detect missing\n', JSON.stringify(missing, null, 2));
|
||||
|
||||
assertAndLog(missing.length === 0, 'eth-phishing-detect', missing);
|
||||
|
||||
errors--;
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user