feat: export finalization services and add finalization estimate mthod#62
feat: export finalization services and add finalization estimate mthod#62dutterbutter merged 4 commits intomainfrom
Conversation
ci-run-tests LCOV of commit
|
|
Codecov Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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
estimateFinalizationmethod that returns gas limit and fee estimates for withdrawal finalization - Exported finalization services from both Viem and Ethers adapters
- Refactored
simulateFinalizeReadinessandfinalizeDepositto 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.
src/adapters/viem/resources/withdrawals/services/finalization.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
What 💻
Why ✋
Evidence 📷
Include screenshots, screen recordings, or
consoleoutput here demonstrating that your changes work as intended