-
Notifications
You must be signed in to change notification settings - Fork 28
Adds unit test, type generation from AA-api and integration testing CI for xion.js #323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: extend-xionjs-to-forego-the-dashboard-flow-if-not-stytch-eng-1330
Are you sure you want to change the base?
Adds unit test, type generation from AA-api and integration testing CI for xion.js #323
Conversation
- Create new @burnt-labs/test-utils package with shared test utilities, builders, and helpers - Add vitest configuration for all packages (abstraxion-core, abstraxion, account-management, signers) - Add integration test setup configuration - Add mock infrastructure for @burnt-labs/signers and webauthn - Update CI workflows for vitest-based testing - Remove deprecated Jest/Babel configs - Add test setup files
- Add script to generate types from account-abstraction-api - Create api.ts and account.ts type definitions in signers package - Remove old api/types.ts file - Add crypto validation utilities (hex, authenticator, normalize) - Add signature verification utilities - Update crypto module exports - Update tsup config for new type exports
…t creation based on txpolling
- @burnt-labs/test-utils: Add shared testing utilities including mock strategies, GrantBuilder, vitest setup with webauthn mocks, and common test helpers - @burnt-labs/account-management: Add 24 unit test files covering: * Account discovery strategies (composite, empty, numia, rpc, subquery) * Grant construction and discovery * Treasury strategies (composite, daodao, direct-query) * Grant utilities (authz, feegrant, format-permissions, contract-validation) * Connection orchestrator flows (account connection, grant creation, redirect, session restoration) * Account state management * Authenticator utilities Includes testing utilities and vitest configuration updates - @burnt-labs/signers: Add 10 unit test files covering: * Crypto utilities (address, authenticator validation, normalize, salt, signature, verify) * Signer implementations (direct-signer, eth-signer) * API types and circular dependency checks Includes testing utilities and vitest configuration - @burnt-labs/abstraxion-core: Add 13 unit test files covering: * AbstraxionAuth and authentication flows * Cache management and utilities * Grant utilities and validation * GranteeSignerClient * API clients (createAccount, client) * Connector registry and external signer connector * Account parser utilities Includes vitest configuration with shared test-utils setup All packages now use shared test-utils for consistent mocking and test setup. Removed legacy mock files in favor of centralized test-utils package.
Update Turnkey integration hooks to align with improved testing infrastructure: - useTurnkeyRawAPI: Refactor for better testability and error handling - useTurnkeyViem: Improve implementation consistency and testing support These changes ensure the demo app works seamlessly with the updated test utilities and provides a better reference implementation for testing patterns.
…or handling and validation Enhance grant-related utilities with improved error handling, type safety, and validation: - feegrant.ts: Add FeeGrantValidationError class with detailed error codes * Return FeeGrantValidationResult type instead of boolean for better error context * Add input validation before making HTTP requests * Improve error messages with HTTP status codes and network error details - authz.ts: Add InvalidContractGrantError for better error handling * Improve contract grant validation with null/undefined checks * Add case-insensitive address comparison (bech32 addresses) * Better error messages for malformed contract grant data - format-permissions.ts: Refactor for better maintainability and type safety * Improve code structure and readability * Better handling of edge cases - grant discovery and strategies: Improve error handling and validation * Better error propagation in treasury strategies * Improved validation in grant creation flow - grant comparison utilities: Add type guards for better type safety * Add isHumanContractExecAuth, isSendAuthorization, isStakeAuthorization, isGenericAuthorization * Improve type safety in grant comparison logic These improvements were made alongside unit test development to ensure robust error handling and better developer experience.
…agement Enhance account management core functionality with better error handling and type safety: - Account discovery strategies: Improve error handling and validation * Better error propagation in composite, numia, rpc, and subquery strategies * Improved input validation - Account state management: Enhance state handling * Better state transitions and error handling - Authenticators: Improve type definitions and utilities * Better type safety in authenticator handling - Orchestrator: Minor improvements for consistency - Type definitions: Enhance type safety across account management types * Improve authenticator, indexer, and treasury type definitions These improvements ensure better reliability and maintainability of account discovery and management flows.
Enhance abstraxion-core with better type guards and error handling: - SignArbSecp256k1HdWallet: Add comprehensive type guards * Add QuickCrypto type for React Native compatibility * Add type guards for serialization root, encrypted serialization, and decrypted documents * Improve type safety throughout wallet serialization/deserialization * Remove unused assert import - AbstraxionAuth: Minor improvements for consistency - Connectors: Improve connector type definitions and error handling * Better type safety in ExternalSignerConnector * Enhanced connector type definitions - Types: Add missing type exports These improvements ensure better type safety and error handling throughout the core authentication and signing functionality.
…ling Enhance React components with better error handling and default values: - AbstraxionContext: Add default context value * Provide default context with proper error messages for improper usage * All functions throw descriptive errors if called before provider mounts * Better initialization error handling (errors handled by controller state machine) - SignerController: Minor improvements for consistency - useAbstraxionClient: Improve hook implementation - Export improvements: Add missing exports - Vitest config: Update integration test configuration These improvements ensure better developer experience and error handling in React components.
Enhance signers package with better error handling and type safety: - Crypto utilities: Improve signature verification and signing * Better error handling in signature operations * Improved type safety - Signer implementations: Enhance direct-signer and passkey-signer * Better error handling and validation * Improved consistency across signer types - Signer factory: Improve factory implementation These improvements ensure better reliability and consistency in signing operations.
Update package.json files and pnpm-lock.yaml with latest dependency versions aligned with testing infrastructure improvements.
|
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
xion-demo-app | 4ce1fda | Dec 02 2025, 05:24 PM |
This PR adds comprehensive unit test coverage, implements a transaction confirmation system, and includes significant code quality improvements across the xion.js monorepo.
Type System Improvements
@burnt-labs/signerspackage for consistencysigners/typesinstead of maintaining duplicate definitionsTransaction Confirmation System
createEthWalletAccount()andcreateSecp256k1Account()functionsComprehensive Unit Test Coverage
@burnt-labs/test-utils: Shared testing utilities with mocks, builders, and vitest setup@burnt-labs/account-management: 24 test files covering account discovery, grant management, treasury strategies, and orchestrator flows@burnt-labs/signers: 10 test files covering crypto utilities and signer implementations@burnt-labs/abstraxion-core: 13 test files covering authentication, caching, grants, and API clientsCode Quality Improvements
FeeGrantValidationError,InvalidContractGrantError) with detailed error codesDemo App Updates
useTurnkeyRawAPI,useTurnkeyViem) for better testing support and consistencyTesting Infrastructure