debug: show decrypt errors on screen for troubleshooting

This commit is contained in:
2026-03-04 03:57:23 +03:00
parent 1f51f08c06
commit 1412d9b1d5
2 changed files with 12 additions and 3 deletions
+5 -1
View File
@@ -54,10 +54,14 @@ export async function getInbox(
const messaging = (api.query as any).messaging;
if (!messaging?.inbox) return [];
const result = await messaging.inbox(era, address);
console.log('[PEZMessage] raw inbox result:', JSON.stringify(result.toHuman?.() ?? result));
if (result.isEmpty || result.length === 0) return [];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return result.map((msg: Record<string, any>) => ({
return result.map((msg: Record<string, any>) => {
console.log('[PEZMessage] msg keys:', Object.keys(msg.toJSON?.() ?? msg));
return msg;
}).map((msg: Record<string, any>) => ({
sender: msg.sender.toString(),
blockNumber: msg.blockNumber?.toNumber?.() ?? msg.block_number?.toNumber?.() ?? 0,
ephemeralPublicKey: hexToBytes(