Skip to content

Commit

Permalink
Silence tests (#483)
Browse files Browse the repository at this point in the history
  • Loading branch information
Duddino authored Dec 5, 2024
1 parent 06eef78 commit d029156
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion debug_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"governance": true,
"i18n": true,
"ledger": true,
"masternode": true
"masternode": true,
"vanity_gen": true
}
9 changes: 7 additions & 2 deletions scripts/dashboard/VanityGen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { ref, computed, watch, nextTick } from 'vue';
import { cChainParams } from '../chain_params.js';
import { MAP_B58 } from '../misc.js';
import { useAlerts } from '../composables/use_alerts.js';
import { debugLog, DebugTopics } from '../debug.js';
const { createAlert } = useAlerts();
const addressPrefix = ref('');
Expand Down Expand Up @@ -72,7 +73,10 @@ function generate() {
Math.floor(window.navigator.hardwareConcurrency * 0.75),
1
);
console.log('Spawning ' + nThreads + ' vanity search threads!');
debugLog(
DebugTopics.VANITY_GEN,
'Spawning ' + nThreads + ' vanity search threads!'
);
for (let i = 0; i < nThreads; i++) {
const worker = new Worker(
new URL('../vanitygen_worker.js', import.meta.url)
Expand All @@ -83,7 +87,8 @@ function generate() {
if (data.pub.substr(1, prefix.length).toLowerCase() === prefix) {
try {
emit('import-wallet', data.priv);
console.log(
debugLog(
DebugTopics.VANITY_GEN,
`VANITY: Found an address after ${attempts.value} attempts!`
);
} finally {
Expand Down
1 change: 1 addition & 0 deletions scripts/debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export const DebugTopics = {
I18N: new DebugTopic('[I18N]', 1 << 7),
LEDGER: new DebugTopic('[LEDGER]', 1 << 8),
MASTERNODE: new DebugTopic('[MASTERNODE]', 1 << 9),
VANITY_GEN: new DebugTopic('[VANITY_GEN]', 1 << 10),
};

let enabledDebug = 0;
Expand Down
3 changes: 3 additions & 0 deletions test_setup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { vi } from 'vitest';
import 'fake-indexeddb/auto';
vi.spyOn(console, 'warn').mockImplementation((message) => {
if (message?.includes && message?.includes('[vue]')) return;
});

// We need to attach the component to a HTML,
// or .isVisible() function does not work
Expand Down

0 comments on commit d029156

Please sign in to comment.