Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e601b89340 |
@@ -5,11 +5,11 @@
|
|||||||
// fraud contract blocklist, and the dust threshold. A regression in any of
|
// fraud contract blocklist, and the dust threshold. A regression in any of
|
||||||
// them does not crash — it silently stops filtering, and poisoned look-alike
|
// them does not crash — it silently stops filtering, and poisoned look-alike
|
||||||
// addresses reappear in the user's transaction history. These tests pin the
|
// addresses reappear in the user's transaction history. These tests pin the
|
||||||
// behaviour down in both directions: the documented attacks must be filtered,
|
// behaviour down in both directions: the two attacks below must be filtered,
|
||||||
// and legitimate transactions must survive untouched.
|
// and legitimate transactions must survive untouched.
|
||||||
//
|
//
|
||||||
// Fixtures are static local objects modelled on the two real attacks cited in
|
// Fixtures are static local objects modelled on two real attacks.
|
||||||
// the README. Nothing here touches the network: global.fetch is replaced
|
// Nothing here touches the network: global.fetch is replaced
|
||||||
// with a throwing stub and the only fetch path in the module under test
|
// with a throwing stub and the only fetch path in the module under test
|
||||||
// (debugFetch, from src/shared/log) is mocked at the module boundary.
|
// (debugFetch, from src/shared/log) is mocked at the module boundary.
|
||||||
|
|
||||||
@@ -81,7 +81,8 @@ const NOVEL_SPAM_SYMBOL = "SPAMTKN";
|
|||||||
// An ordinary counterparty for legitimate-transaction fixtures.
|
// An ordinary counterparty for legitimate-transaction fixtures.
|
||||||
const ORDINARY_PEER = "0x5aa0f9f1e0a1d0e0e5c1e7ce3b7dbbe9c19f0a11";
|
const ORDINARY_PEER = "0x5aa0f9f1e0a1d0e0e5c1e7ce3b7dbbe9c19f0a11";
|
||||||
|
|
||||||
// The documented default settings (README, Settings; state.js:24-27).
|
// The documented default settings (README, Settings; DEFAULT_STATE in
|
||||||
|
// src/shared/persistedState.js).
|
||||||
const DEFAULT_FILTERS = {
|
const DEFAULT_FILTERS = {
|
||||||
hideSpoofedSymbols: true,
|
hideSpoofedSymbols: true,
|
||||||
hideLowHolderTokens: true,
|
hideLowHolderTokens: true,
|
||||||
@@ -401,8 +402,8 @@ describe("known-symbol spoof verification", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Turning the other three filters off must not turn this one off: each
|
// Turning the other three filters off must not turn this one off: each
|
||||||
// filter is independent, and this is the one the README calls out as the
|
// filter is independent, and this is the one that stops the fake "ETH"
|
||||||
// defense against the fake "ETH" attack.
|
// attack.
|
||||||
test("the check still runs when the other three filters are off", () => {
|
test("the check still runs when the other three filters are off", () => {
|
||||||
const result = filterTransactions(
|
const result = filterTransactions(
|
||||||
[fakeEthTokenTransfer()],
|
[fakeEthTokenTransfer()],
|
||||||
|
|||||||
Reference in new issue
Block a user