chore: drop manual birthday debug page
**Motivations :** - remove obsolete local-only birthday test helper **Modifications :** - delete test-birthday-setup.html development page - clean related bootstrap url staging **Page affectées :** - test-birthday-setup.html
This commit is contained in:
parent
74093a12eb
commit
76556e1f6e
@ -24,9 +24,7 @@ import { DATABASE_CONFIG } from './database-config';
|
||||
export const U32_MAX = 4294967295;
|
||||
|
||||
const BASEURL = import.meta.env.VITE_BASEURL || `http://localhost`;
|
||||
const BOOTSTRAPURL = sanitizeBootstrapUrls(
|
||||
import.meta.env.VITE_BOOTSTRAPURL || `${BASEURL}:8090`
|
||||
);
|
||||
const BOOTSTRAPURL = sanitizeBootstrapUrls(import.meta.env.VITE_BOOTSTRAPURL || `${BASEURL}:8090`);
|
||||
const STORAGEURL = import.meta.env.VITE_STORAGEURL || `${BASEURL}:8081`;
|
||||
const BLINDBITURL = import.meta.env.VITE_BLINDBITURL || `${BASEURL}:8000`;
|
||||
const DEFAULTAMOUNT = 1000n;
|
||||
|
||||
@ -1,144 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Test Birthday Setup</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
}
|
||||
.log {
|
||||
background: #f5f5f5;
|
||||
border: 1px solid #ddd;
|
||||
padding: 10px;
|
||||
margin: 10px 0;
|
||||
border-radius: 4px;
|
||||
font-family: monospace;
|
||||
white-space: pre-wrap;
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
button {
|
||||
background: #007bff;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 10px 20px;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
margin: 5px;
|
||||
}
|
||||
button:hover {
|
||||
background: #0056b3;
|
||||
}
|
||||
button:disabled {
|
||||
background: #ccc;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Test Birthday Setup - Debug Device Not Found</h1>
|
||||
|
||||
<div>
|
||||
<button onclick="testWalletCreation()">1. Créer Wallet</button>
|
||||
<button onclick="testDeviceRetrieval()">2. Récupérer Device</button>
|
||||
<button onclick="testBirthdaySetup()">3. Test Birthday Setup</button>
|
||||
<button onclick="clearLogs()">Effacer Logs</button>
|
||||
</div>
|
||||
|
||||
<div id="logs" class="log"></div>
|
||||
|
||||
<script type="module">
|
||||
import Services from './src/services/service.js';
|
||||
import { DATABASE_CONFIG } from './src/services/database-config.js';
|
||||
|
||||
const logs = document.getElementById('logs');
|
||||
|
||||
function log(message) {
|
||||
const timestamp = new Date().toLocaleTimeString();
|
||||
logs.textContent += `[${timestamp}] ${message}\n`;
|
||||
logs.scrollTop = logs.scrollHeight;
|
||||
console.log(message);
|
||||
}
|
||||
|
||||
function clearLogs() {
|
||||
logs.textContent = '';
|
||||
}
|
||||
|
||||
window.clearLogs = clearLogs;
|
||||
|
||||
async function testWalletCreation() {
|
||||
log('🔄 Test: Création du wallet...');
|
||||
try {
|
||||
// Simuler la création du wallet comme dans wallet-setup.ts
|
||||
const services = await Services.getInstance();
|
||||
log('✅ Services initialisés');
|
||||
|
||||
// Créer un device avec le SDK
|
||||
const device = services.sdkClient.create_device(0);
|
||||
log('✅ Device créé avec le SDK');
|
||||
|
||||
// Sauvegarder le device
|
||||
await services.saveDeviceInDatabase(device);
|
||||
log('✅ Device sauvegardé dans la base de données');
|
||||
|
||||
log('🎉 Test de création du wallet réussi!');
|
||||
} catch (error) {
|
||||
log(`❌ Erreur lors de la création du wallet: ${error.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
async function testDeviceRetrieval() {
|
||||
log('🔄 Test: Récupération du device...');
|
||||
try {
|
||||
const services = await Services.getInstance();
|
||||
log('✅ Services initialisés');
|
||||
|
||||
const device = await services.getDeviceFromDatabase();
|
||||
if (device) {
|
||||
log('✅ Device récupéré avec succès');
|
||||
log(`🔍 Device details: ${JSON.stringify({
|
||||
hasSpWallet: !!device.sp_wallet,
|
||||
birthday: device.sp_wallet?.birthday,
|
||||
address: device.sp_wallet?.address
|
||||
}, null, 2)}`);
|
||||
} else {
|
||||
log('❌ Aucun device trouvé dans la base de données');
|
||||
}
|
||||
} catch (error) {
|
||||
log(`❌ Erreur lors de la récupération du device: ${error.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
async function testBirthdaySetup() {
|
||||
log('🔄 Test: Birthday Setup complet...');
|
||||
try {
|
||||
const services = await Services.getInstance();
|
||||
log('✅ Services initialisés');
|
||||
|
||||
// Connexion aux relais
|
||||
await services.connectAllRelays();
|
||||
log('✅ Relays connectés');
|
||||
|
||||
// Mettre à jour la date anniversaire
|
||||
await services.updateDeviceBlockHeight();
|
||||
log('✅ Birthday updated successfully');
|
||||
|
||||
log('🎉 Test de birthday setup réussi!');
|
||||
} catch (error) {
|
||||
log(`❌ Erreur lors du birthday setup: ${error.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
window.testWalletCreation = testWalletCreation;
|
||||
window.testDeviceRetrieval = testDeviceRetrieval;
|
||||
window.testBirthdaySetup = testBirthdaySetup;
|
||||
|
||||
log('🚀 Test page chargée. Cliquez sur les boutons pour tester.');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user