chore: daily nip-research-agent run

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-02-21 23:46:06 +00:00
1 parent ecdc29c40d
commit b8cbf7ca84
8 files changed
+154 -17

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
import { normalizeHexPubkey } from '../js/utils/nostrHelpers.js';
// Mock window.NostrTools
global.window = {
NostrTools: {
nip19: {
decode: (str) => {
if (str.startsWith('npub1')) return { type: 'npub', data: 'hexpubkey' };
if (str.startsWith('nprofile1')) return { type: 'nprofile', data: { pubkey: 'hexpubkey' } };
throw new Error('Invalid');
},
npubEncode: (hex) => 'npub1' + hex
}
}
};
console.log('Testing normalizeHexPubkey with various inputs...');
const hex = '0000000000000000000000000000000000000000000000000000000000000001';
const npub = 'npub1test';
const nprofile = 'nprofile1test';
const resHex = normalizeHexPubkey(hex);
console.log(`Hex input: ${resHex === hex ? 'PASS' : 'FAIL'} (${resHex})`);
const resNpub = normalizeHexPubkey(npub);
console.log(`Npub input: ${resNpub === 'hexpubkey' ? 'PASS' : 'FAIL'} (${resNpub})`);
const resNprofile = normalizeHexPubkey(nprofile);
console.log(`Nprofile input: ${resNprofile === 'hexpubkey' ? 'PASS' : 'FAIL'} (${resNprofile})`);
if (resNprofile !== 'hexpubkey') {
console.log('Confirmed: nprofile is NOT handled by normalizeHexPubkey.');
}