From 89b70c758e7c7f8b228daf0953b7cc0544d505e5 Mon Sep 17 00:00:00 2001 From: Danish Arora Date: Mon, 15 Sep 2025 14:39:41 +0530 Subject: [PATCH] chore: signature request shows timestamp in human readable format --- src/lib/delegation/crypto.ts | 3 ++- src/lib/forum/__tests__/relevance.test.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/delegation/crypto.ts b/src/lib/delegation/crypto.ts index 52df0de..7a4461e 100644 --- a/src/lib/delegation/crypto.ts +++ b/src/lib/delegation/crypto.ts @@ -25,7 +25,8 @@ export class DelegationCrypto { expiryTimestamp: number, nonce: string ): string { - return `I, ${walletAddress}, authorize browser key ${browserPublicKey} until ${expiryTimestamp} (nonce: ${nonce})`; + const expiryDate = new Date(expiryTimestamp).toLocaleString(); + return `I, ${walletAddress}, authorize browser key ${browserPublicKey} until ${expiryDate} (nonce: ${nonce})`; } /** diff --git a/src/lib/forum/__tests__/relevance.test.ts b/src/lib/forum/__tests__/relevance.test.ts index 0c188a6..e7c8643 100644 --- a/src/lib/forum/__tests__/relevance.test.ts +++ b/src/lib/forum/__tests__/relevance.test.ts @@ -11,9 +11,9 @@ import { expect, describe, beforeEach, it } from 'vitest'; // Mock delegation proof for tests const mockDelegationProof: DelegationProof = { - authMessage: 'I authorize browser key: test-key until 9999999999', + authMessage: 'I, test-address, authorize browser key test-key until 20/11/2286, 11:16:39 pm (nonce: test-nonce)', walletSignature: 'mock-signature', - expiryTimestamp: 9999999999, + expiryTimestamp: 9999999999999, walletAddress: 'test-address', walletType: 'ethereum', };