UNPKG

@lit-protocol/e2e

Version:

Lit Protocol E2E testing package for running comprehensive integration tests

88 lines (87 loc) 2.91 kB
/** * Naga Health Manager * * This module implements health checks for Naga network endpoints. * It tests the core functionality of the Lit Protocol network by executing * a series of endpoint tests using a single test account. * * Tested Endpoints: * 1. Handshake - Verifies basic node connectivity * 2. PKP Sign - Tests PKP signing functionality * 3. Sign Session Key - Tests session key signing (via PKP auth context creation) * 4. Execute JS - Tests Lit Actions execution * 5. Decrypt - Tests encryption and decryption flow * * Usage: * const manager = new NagaHealthManager(ctx); * await manager.handshakeTest(); * await manager.pkpSignTest(); * // ... other tests */ import { initHealthCheck } from './health-init'; type HealthCheckContext = Awaited<ReturnType<typeof initHealthCheck>>; export declare class NagaHealthManager { private ctx; constructor(ctx: HealthCheckContext); /** * Test 1: Handshake Test * * Verifies basic connectivity to Lit nodes by checking if the client * is properly initialized and connected. * * This is the most basic health check - if this fails, the network is down. */ handshakeTest: () => Promise<void>; /** * Test 2: PKP Sign Test * * Tests the PKP signing endpoint by signing a simple message. * This verifies that: * - The PKP is accessible * - The auth context is valid * - The signing endpoint is operational */ pkpSignTest: () => Promise<void>; /** * Test 3: Sign Session Key Test * * Tests the session key signing endpoint by creating a PKP auth context. * This involves the signSessionKey endpoint which is critical for * establishing authenticated sessions with PKPs. */ signSessionKeyTest: () => Promise<void>; /** * Test 4: Execute JS Test * * Tests Lit Actions execution by running a simple JavaScript code * that performs an ECDSA signature. * * This verifies: * - Lit Actions runtime is operational * - Code execution environment is working * - Signing within actions works */ executeJsTest: () => Promise<void>; /** * Test 5: Decrypt Test * * Tests the encryption and decryption flow: * 1. Encrypts data with access control conditions * 2. Decrypts the data using the same account * * This verifies: * - Encryption endpoint works * - Access control condition evaluation works * - Decryption endpoint works * - End-to-end encryption flow is operational */ decryptTest: () => Promise<void>; /** * Test 6: Wrapped Keys Service Test * * Validates the wrapped keys service by importing an externally generated key * and immediately exporting it to confirm correct round-trip encryption. */ wrappedKeysTest: () => Promise<void>; } export {};