Draft
Conversation
Signed-off-by: Mario Francia <mariofranciarius@gmail.com>
Signed-off-by: Mario Francia <mariofranciarius@gmail.com>
Signed-off-by: Mario Francia <mariofranciarius@gmail.com>
Signed-off-by: Mario Francia <mariofranciarius@gmail.com>
….ts` Signed-off-by: Mario Francia <mariofranciarius@gmail.com>
…ge cases and improve safety Signed-off-by: Mario Francia <mariofranciarius@gmail.com>
…andle edge cases and improve safety" This reverts commit ba6cb33. Signed-off-by: Mario Francia <mariofranciarius@gmail.com>
Signed-off-by: Mario Francia <mariofranciarius@gmail.com>
Signed-off-by: Mario Francia <mariofranciarius@gmail.com>
Signed-off-by: Mario Francia <mariofranciarius@gmail.com>
Signed-off-by: Mario Francia <mariofranciarius@gmail.com>
Signed-off-by: Mario Francia <mariofranciarius@gmail.com>
Signed-off-by: jaime-iobermudez <jaime.bermudez@io.builders>
Signed-off-by: jaime-iobermudez <jaime.bermudez@io.builders>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Signed-off-by: jaime-iobermudez <jaime.bermudez@io.builders>
Signed-off-by: Mario Francia <mariofranciarius@gmail.com> Signed-off-by: Alberto Molina <alberto@io.builders> Co-authored-by: Alberto Molina <alberto@io.builders>
a3ea045 to
60f35fc
Compare
Signed-off-by: Alberto Molina <alberto@io.builders>
Signed-off-by: Alberto Molina <alberto@io.builders>
Signed-off-by: jaime-iobermudez <jaime.bermudez@io.builders>
- Enhanced commit-msg hook to verify/auto-add DCO sign-off - Added pre-push hook as final gate requiring both DCO + GPG - Created setup-git.sh script for developer onboarding - Updated CONTRIBUTING.md with setup instructions The enforcement layers: 1. pre-commit: lint-staged for code quality 2. commit-msg: DCO verification + auto-addition + commitlint 3. pre-push: blocks push without DCO + GPG signatures Signed-off-by: Miguel_LZPF <miguel.carpena@io.builders>
Reorganize the monolithic registry generator into a well-structured module with clear separation of concerns: Core Components: - extractor.ts: Contract metadata extraction from artifacts - scanner.ts: Filesystem scanning and contract discovery - generator.ts: Code generation logic (formerly registryGenerator.ts) - pipeline.ts: Main generation orchestration - types.ts: Centralized type definitions Utilities: - abiExtractor: ABI parsing and extraction - fileUtils: File I/O operations - logging: Structured logging - solidityParser: Comprehensive Solidity parser avoiding TypeChain Benefits: - Eliminated 6+ second TypeChain import overhead - Improved maintainability with single-responsibility modules - Better testability with isolated concerns - Flexible caching support via --use-cache flag - New npm script: npm run generate:registry:cached Infrastructure: - Updated barrel exports (index.ts files) - Cleaned up atsRegistry.data.ts (removed unused exports) - Updated CLI entry point with improved argument parsing - Enhanced logging capabilities - Updated integration tests Removed: - Old generateRegistry.ts monolithic entry point - Duplicated operations from infrastructure layer Reorganized files: - scripts/tools/generators/registryGenerator.ts → registry-generator/core/generator.ts - scripts/infrastructure/operations/generateRegistryPipeline.ts → registry-generator/pipeline.ts Signed-off-by: Miguel_LZPF <miguel.carpena@io.builders>
Migrate from ts-node with tsconfig-paths/register to tsx for faster, simpler TypeScript script execution. Remove redundant ts-node configuration from tsconfig.json since tsx handles path aliases natively. Changes: - packages/ats/contracts/package.json: Replace all ts-node invocations with tsx in CLI entry points (deploy*, upgrade*, generate:registry) - packages/ats/contracts/tsconfig.json: Remove ts-node configuration block - package.json: Add convenience scripts for contracts utilities exposed at root level (test:scripts:unit:parallel, test:scripts:integration:parallel, upgrade:previewnet, generate:registry, local:hardhat, size, slither, doc) Benefits: - Faster script execution with tsx (no tsconfig-paths dependency) - Simpler configuration (one less configuration block) - Better IDE integration and debugging support - Scripts available directly from monorepo root for convenience Signed-off-by: Miguel_LZPF <miguel.carpena@io.builders>
The pre-push hook was incorrectly rejecting commits that had valid GPG signatures but whose public keys were not in the local keyring. This caused pushes to fail when rebasing from branches with commits signed by other team members. Changed from `git verify-commit` (requires public key) to `git log --format=%G?` which checks if a signature EXISTS without requiring verification. The hook now accepts any signature status except 'N' (no signature). Signed-off-by: Miguel Carpena <miguel.carpena@io.builders> Signed-off-by: Miguel_LZPF <miguel.carpena@io.builders>
Signed-off-by: jaime-iobermudez <jaime.bermudez@io.builders>
Signed-off-by: Alberto Molina <alberto@io.builders>
Signed-off-by: Mario Francia <mariofranciarius@gmail.com>
Signed-off-by: Alberto Molina <alberto@io.builders>
Signed-off-by: Luigi Navarro <luigi@io.builders>
Signed-off-by: Luigi Navarro <luigi@io.builders>
- Updated @typechain/ethers-v5 from 10.2.1 to ^11.1.2 for improved type generation - Updated @typechain/hardhat from ^6.1.2 to ^6.1.6 for bug fixes and compatibility - Updated override constraint for @typechain/ethers-v5 to maintain version consistency - Added new npm script 'test:scripts:unit:coverage' to generate coverage reports for scripts directory with c8 Signed-off-by: Miguel_LZPF <miguel.carpena@io.builders>
Add unit tests for checkpoint management, deployment file operations, and test helpers to improve infrastructure code coverage. Regenerate facet registry with resolver keys for all sustainability performance target rate facets. Changes: - test/helpers: Add createCompletedTestCheckpoint() and test helper functions for building complete checkpoint states - test/helpers/index.ts: New barrel export for centralized test helper imports - test: Add comprehensive unit tests for CheckpointManager, utilities, and deployment file operations - atsRegistry.data.ts: Regenerate registry with resolver keys for 26 SPT facets, enabling proper facet resolution - IFactory.sol: Update quote style to match project formatting rules Signed-off-by: Miguel_LZPF <miguel.carpena@io.builders>
Extended deployment infrastructure test coverage with new test suites: - deploymentFiles.test.ts: Extended with 31 new tests for file utilities including generateTimestamp, generateDeploymentFilename, getDeploymentsDir, getNetworkDeploymentDir, loadDeploymentByWorkflow, listDeploymentsByWorkflow, and comprehensive edge case coverage - converters.test.ts: New 25-test suite for checkpoint converter functions covering isSuccess, isFailure, toDeploymentResult, toDeployBlrResult, toDeployFactoryResult, toConfigurationData, convertCheckpointFacets, and extractCheckpointResults with proper type narrowing and error handling - facetDeployment.test.ts: New 9-test suite for getFacetDeploymentSummary covering deployed, failed, and skipped facet tracking with complete coverage of summary generation logic Test metrics: - Total tests increased from 176 to 241 (+65 tests) - Statements: 79.32% → 80.13% - Branches: 75.97% → 79.10% - Functions: 27.39% → 32.99% Additional improvements: - Added test helpers in constants.ts for reusable test data - Updated checkpoint utils.test.ts with improved test organization - Verified all infrastructure exports properly configured Signed-off-by: Miguel_LZPF <miguel.carpena@io.builders>
Add comprehensive unit test coverage for deployment and infrastructure utilities: Test Files Added: - combineRegistries.test.ts: Tests registry combination and conflict resolution - config.test.ts: Tests network configuration retrieval and validation - networkConfig.test.ts: Tests deployment config lookup and network type detection - hedera.test.ts: Tests Hedera network detection and mirror node URL resolution - logging.test.ts: Tests logger configuration and log level management - naming.test.ts: Tests contract name resolution and TimeTravel variant handling - transaction.test.ts: Tests error extraction and error type detection Test Constants: - Added network identifiers (previewnet, local, hedera-local, short aliases) - Added valid tx hash format (0x + 64 hex characters) - Added mock resolver keys, facet names, logger prefixes, and contract names - Added invalid/non-existent values for negative testing Code Quality: - Added Apache-2.0 SPDX license headers - Fixed quote style consistency (single to double quotes) - Enhanced TEST_TX_HASHES with proper 66-character format - Improved TEST_NETWORKS with comprehensive network variants All tests use existing infrastructure utilities and validate behavior across local, Hedera, and production networks with appropriate configuration. Signed-off-by: Miguel_LZPF <miguel.carpena@io.builders>
…tests Add comprehensive unit tests for atsRegistry factory functions and registry helpers to achieve 100% coverage on atsRegistry.data.ts file. Tests cover all facet factory branches including TimeTravel variants and registry lookup functions. Coverage configuration improvements: - Add .c8rc.json configuration file with standardized c8 settings - Simplify test:scripts:unit:coverage npm script to use c8rc config - Configure coverage to include scripts/** with proper exclusions Test improvements: - Add atsRegistry.data.test.ts with comprehensive factory function tests - Dynamically test all 150+ facets that have factory functions - Test TimeTravel factory branch (previously uncovered) - Test registry helper functions and constants - Update hedera.test.ts to suppress logger warnings during tests This achieves 100% coverage on atsRegistry.data.ts while maintaining existing test quality and execution speed. Signed-off-by: Miguel_LZPF <miguel.carpena@io.builders>
Restructure scripts test suite to improve clarity and maintainability: Test Organization: - Move infrastructure/checkpoint/config tests from unit/ to integration/ (these require Hardhat fixtures and external dependencies) - Create unit/domain/factory/ for factory-specific unit tests - Separate pure unit tests from integration tests by directory structure New Unit Test Coverage: - deploy.test.ts: Factory deploy function behavior and error handling - deployBondToken.test.ts: Bond token deployment configurations (457 lines) - Bond variants (fixed-rate, floating-rate, perpetual) - Configuration ID and version handling - Coupon settings and maturity dates - deployEquityToken.test.ts: Equity token deployment configurations (455 lines) - Equity variants and configurations - Configuration ID and version handling - deployBondVariants.test.ts: Bond variant selection logic (583 lines) - Dynamic selection based on interest type - Coupon frequency and maturity validation - mockFactories.ts: Shared test fixtures and mock implementations (470 lines) Test Infrastructure Improvements: - Update test helpers constants.ts with comprehensive organization (939 lines) - Add 6-section documentation with clear category grouping - Add TEST_STANDARD_CONTRACTS constants (AccessControlFacet, PauseFacet, etc.) - Add TEST_FACET_NAMES for facet identity tests - Add TEST_TIME_TRAVEL_VARIANTS for TimeTravel facet variants - Add TEST_DIRS for path-based operations - Extend TEST_ADDRESSES with NO_CODE_ALT for additional coverage Test Runner Configuration: - Switch unit tests from Hardhat to Mocha for faster execution (unit tests don't need Hardhat, reducing initialization overhead) - Update test:scripts:unit* scripts to use Mocha with tsx - Maintain 10-second timeout for script operations - Keep integration tests on Hardhat for fixture support Utility Test Updates: - Update facetDeployment.test.ts to use TEST_STANDARD_CONTRACTS - Update deploymentFiles.test.ts with improved test data - Update naming.test.ts for better constant reusability Documentation: - Add Testing section to scripts/README.md with test structure overview - Document unit vs integration test distinction - Add examples of test constants usage - Include running tests commands with parallel options Benefits: - Clear separation of pure unit tests from integration tests - Factory logic thoroughly tested with 2,072 lines of new test code - Faster test execution with Mocha for unit tests - Centralized test constants reduce magic strings and improve maintainability - Comprehensive documentation for test organization Signed-off-by: Miguel_LZPF <miguel.carpena@io.builders>
Rename test/contracts/unit/ to test/contracts/integration/ to better reflect test classification. These tests deploy real contracts to Hardhat's EVM and test contract interactions, making them integration tests rather than true unit tests. Updated all related package.json test scripts to reference the new integration path for consistency across the codebase. Changes: - Moved 52 test files from unit/ to integration/ directory - Updated 8 npm test script references in package.json - Maintains all test functionality and import paths Signed-off-by: Miguel_LZPF <miguel.carpena@io.builders>
Signed-off-by: Mario Francia <mariofranciarius@gmail.com>
Signed-off-by: Luigi Navarro <luigi@io.builders>
Consolidates repeated test setup patterns into reusable helpers: - Created testSetup.ts with silenceScriptLogging() to replace direct configureLogger calls across all integration tests - Added checkpoint cleanup hook factory (createCheckpointCleanupHooks) to eliminate 30+ lines of duplicated cleanup logic in upgradeTupProxies - Added centralized test constants (EIP1967_SLOTS, TEST_GAS_LIMITS, TEST_INIT_VALUES) replacing inline test-specific constants - Reorganized imports in all integration tests for clarity (infrastructure → domain → test helpers → contract types) Benefits: - Reduces code duplication (~100 lines eliminated) - Improves test maintainability through shared utilities - Standardizes test setup patterns across all test files - Makes tests easier to extend with new logging/cleanup needs Signed-off-by: Miguel_LZPF <miguel.carpena@io.builders>
…te magic numbers Adds TEST_DELAYS and TEST_OPTIONS constants to test/helpers/constants.ts: - TEST_DELAYS.SHORT (5ms) and TEST_DELAYS.MEDIUM (10ms) for timing operations - TEST_OPTIONS.CONFIRMATIONS_HARDHAT (0) for Hardhat transaction confirmations Updates all integration tests to use the new constants: - CheckpointManager.test.ts: 9 instances of hardcoded 5/10ms delays - upgradeTupProxies.test.ts: 20 instances of confirmations: 0 - updateResolverProxyConfig.test.ts: 17 instances of confirmations: 0 Fixes TypeScript type errors in CheckpointManager.test.ts: - Adds `as string` type assertions for TEST_ADDRESSES and TEST_TX_HASHES - Ensures strict type checking compliance Reclassifies atsRegistry.data.test.ts from integration to unit directory: - Moves test/scripts/integration/domain/atsRegistry.data.test.ts - To test/scripts/unit/domain/atsRegistry.data.test.ts - Test validates data structure, not integration behavior Signed-off-by: Miguel_LZPF <miguel.carpena@io.builders>
…output types - Added root-level npm scripts for scripts test coverage commands - ats:contracts:test:scripts:coverage - ats:contracts:test:scripts:unit:coverage - ats:contracts:test:scripts:integration:coverage - Updated scripts test commands to use --no-compile flag for improved performance - Consolidated deployment output types to use centralized DeploymentOutputType from infrastructure - Updated checkpoint/utils.ts to import from infrastructure barrel - Removed redundant type export from deploySystemWithNewBlr.ts - Improves type consistency across workflow modules - Formatted package.json for better readability (multi-line arrays) - Added SPDX license header to deploySystemWithNewBlr.ts Signed-off-by: Miguel_LZPF <miguel.carpena@io.builders>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Type of change
Testing
Node version:
Checklist