Skip to content

feat: export finalization services and add finalization estimate mthod#62

Merged
dutterbutter merged 4 commits intomainfrom
db/export-finalization-services
Nov 13, 2025
Merged

feat: export finalization services and add finalization estimate mthod#62
dutterbutter merged 4 commits intomainfrom
db/export-finalization-services

Conversation

@dutterbutter
Copy link
Owner

What 💻

  • Export finalization services
  • Add finalization estimate method

Why ✋

  • Utilities for devs

Evidence 📷

Include screenshots, screen recordings, or console output here demonstrating that your changes work as intended

Copilot AI review requested due to automatic review settings November 13, 2025 15:45
@github-actions
Copy link

github-actions bot commented Nov 13, 2025

ci-run-tests LCOV of commit f23ed49 during ci-run-tests #172

Summary coverage rate:
  lines......: 84.9% (10016 of 11791 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate:
                                                                    |Lines       |Functions  |Branches    
  Filename                                                          |Rate     Num|Rate    Num|Rate     Num
  ========================================================================================================
  src/adapters/ethers/resources/withdrawals/index.ts                | 0.0%    236|    -     0|    -      0
  src/adapters/ethers/resources/withdrawals/services/finalization.ts| 0.0%    185|    -     0|    -      0
  src/adapters/viem/resources/withdrawals/index.ts                  | 0.0%    265|    -     0|    -      0
  src/adapters/viem/resources/withdrawals/services/finalization.ts  | 0.0%    208|    -     0|    -      0
  src/core/types/errors.ts                                          | 0.0%    127|    -     0|    -      0

@codecov-commenter
Copy link

codecov-commenter commented Nov 13, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 34.28571% with 138 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.94%. Comparing base (7a2b368) to head (f23ed49).

Files with missing lines Patch % Lines
...iem/resources/withdrawals/services/finalization.ts 23.80% 80 Missing ⚠️
...ers/resources/withdrawals/services/finalization.ts 38.46% 56 Missing ⚠️
src/adapters/ethers/resources/withdrawals/index.ts 85.71% 1 Missing ⚠️
src/adapters/viem/resources/withdrawals/index.ts 83.33% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #62      +/-   ##
==========================================
- Coverage   85.93%   84.94%   -0.99%     
==========================================
  Files          75       75              
  Lines       11624    11791     +167     
==========================================
+ Hits         9989    10016      +27     
- Misses       1635     1775     +140     
Flag Coverage Δ
combined 84.94% <34.28%> (-0.99%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new estimateFinalization method to the finalization services and exports both the createFinalizationServices function and FinalizationServices type for use by external developers. The PR also refactors the internal implementation by removing the nullifier parameter from several methods, making them fetch the L1 nullifier address internally.

Key Changes:

  • Added estimateFinalization method that returns gas limit and fee estimates for withdrawal finalization
  • Exported finalization services from both Viem and Ethers adapters
  • Refactored simulateFinalizeReadiness and finalizeDeposit to fetch L1 nullifier internally

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/core/types/flows/withdrawals.ts Added FinalizationEstimate interface defining gas and fee estimate structure
src/core/types/errors.ts Added error operation constant for finalization fee estimation
src/adapters/viem/resources/withdrawals/services/finalization.ts Implemented estimateFinalization method and refactored methods to fetch L1 nullifier internally
src/adapters/viem/resources/withdrawals/index.ts Updated call sites and exported finalization services
src/adapters/viem/index.ts Re-exported finalization services at adapter level
src/adapters/ethers/resources/withdrawals/services/finalization.ts Implemented estimateFinalization method with proper null-coalescing for fee data
src/adapters/ethers/resources/withdrawals/index.ts Updated call sites and exported finalization services
src/adapters/ethers/index.ts Re-exported finalization services at adapter level

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dutterbutter dutterbutter merged commit bfc36cf into main Nov 13, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants