mirror of
https://github.com/pezkuwichain/phishing.git
synced 2026-04-21 23:48:01 +00:00
Check addesses against known list (#98)
This commit is contained in:
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"binance": [
|
||||||
|
"1exaAg2VJRQbyUBAeXcktChCAqjVP9TUxF3zo23R2T6EGdE"
|
||||||
|
],
|
||||||
|
"simpleswap.io": [
|
||||||
|
"14QsifyV7XyEDay8C862PNLRngid2AGZmtCwz1K88x5gpf58"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
// Copyright 2020-2021 @polkadot/phishing authors & contributors
|
// Copyright 2020-2021 @polkadot/phishing authors & contributors
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
import denied from '../../../address.json';
|
||||||
|
import allowed from '../../../known.json';
|
||||||
import { checkAddress, checkIfDenied } from '.';
|
import { checkAddress, checkIfDenied } from '.';
|
||||||
|
|
||||||
describe('checkIfDenied', (): void => {
|
describe('checkIfDenied', (): void => {
|
||||||
@@ -60,3 +62,12 @@ describe('checkAddress', (): void => {
|
|||||||
).toEqual('polkadots.network');
|
).toEqual('polkadots.network');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('check additions', (): void => {
|
||||||
|
it('has no entries on the known addresses list', (): void => {
|
||||||
|
const added = Object.values(denied as Record<string, string[]>).reduce((all: string[], addrs: string[]) => all.concat(addrs), []);
|
||||||
|
const dupes = Object.entries(allowed as Record<string, string[]>).reduce((all: [string, string][], [site, addrs]) => all.concat(addrs.map((a) => [site, a])), []).filter(([, a]) => added.includes(a));
|
||||||
|
|
||||||
|
expect(dupes).toEqual([]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
"@polkadot/phishing": ["packages/phishing/src"],
|
"@polkadot/phishing": ["packages/phishing/src"],
|
||||||
"@polkadot/phishing/*": ["packages/phishing/src/*"]
|
"@polkadot/phishing/*": ["packages/phishing/src/*"]
|
||||||
},
|
},
|
||||||
|
"resolveJsonModule": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"typeRoots": [
|
"typeRoots": [
|
||||||
"./node_modules/@types"
|
"./node_modules/@types"
|
||||||
|
|||||||
Reference in New Issue
Block a user