Remove SmartTransaction and CapacityManager in favor of TransactionLike#18
Remove SmartTransaction and CapacityManager in favor of TransactionLike#18
Conversation
…n CCC core - Add ErrorNervosDaoOutputLimit error class in transactionErrors.ts - Add assertDaoOutputLimit standalone utility in transaction.ts using full Script.eq() - Add completeFee safety net calling assertDaoOutputLimit before both return paths - Both exported via CCC barrel (existing export * pattern) - Add local patch mechanism to ccc-dev record/replay for deterministic builds - Record ccc-dev pins with local patch applied
…putLimit - DaoManager: deposit, requestWithdrawal, withdraw now async with client param - LogicManager.deposit now async with client param - OwnedOwnerManager: requestWithdrawal, withdraw now async with client param - SmartTransaction.completeFee DAO check replaced with single assertDaoOutputLimit call - Zero inline "outputs.length > 64" checks remain in packages/
- Create 01-01-SUMMARY.md with execution results - Update STATE.md with plan completion and decisions - Update ROADMAP.md progress (1/3 plans) - Mark SMTX-06 complete in REQUIREMENTS.md
- Remove getHeader() function and HeaderKey type from @ickb/utils public API - Move getHeader/HeaderKey to transaction.ts as internal (non-exported) for SmartTransaction use until Plan 03 deletion - Move TransactionHeader interface from transaction.ts to utils.ts for downstream consumers - Inline 5 standalone getHeader() call sites with direct CCC client calls (getTransactionWithHeader/getHeaderByNumber) with null checks - Inline 2 tx.getHeader() instance method call sites in core/udt.ts with CCC client calls - Replace 3 addHeaders() call sites with direct tx.headerDeps push with dedup logic
- Add 01-02-SUMMARY.md with execution results - Update STATE.md with position, decisions, metrics - Update ROADMAP.md with plan progress (2/3 in phase 01) - Mark SMTX-04 requirement complete in REQUIREMENTS.md
…o TransactionLike - All manager methods across 5 library packages accept ccc.TransactionLike and return ccc.Transaction - Each method converts with ccc.Transaction.from(txLike) at entry - All 8 addUdtHandlers() calls replaced with tx.addCellDeps(this.udtHandler.cellDeps) - Inner calls to sub-managers capture returned Transaction for cascading returns - UdtHandler interface and UdtManager class updated with TransactionLike signatures - No consumer imports SmartTransaction (class still exists but unused externally)
…, and clean exports - Delete packages/utils/src/transaction.ts (SmartTransaction, SmartTransactionLike, addUdtHandlers) - Delete packages/utils/src/capacity.ts (CapacityManager, CapacityCell, addCapacities) - Move defaultFindCellsLimit constant from capacity.ts to utils.ts - Remove capacity.js and transaction.js barrel re-exports from index.ts - Replace CapacityManager in SDK getCkb() with direct client.findCellsOnChain calls - Remove CapacityManager from SDK constructor and getConfig return type - Update faucet app: ccc.Transaction.default() + inline findCellsOnChain
- SUMMARY.md documents 2 tasks, 13 files changed, 2 deviations - STATE.md updated: Phase 1 complete (3/3 plans), 15% progress - ROADMAP.md updated: Phase 1 marked complete - REQUIREMENTS.md updated: SMTX-01, SMTX-02, SMTX-05 marked complete
The DAO output limit check is now merged upstream. Replace the local patch with a merge ref, fix local-patch index arithmetic in record/replay, improve error cleanup to preserve local patches on failure, and skip auto-replay during ccc:record to avoid conflicts.
Align parameter documentation with the renamed method signatures from the SmartTransaction → TransactionLike migration.
Summary of ChangesHello @phroi, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request undertakes a significant refactoring effort by eliminating the custom Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request successfully removes the SmartTransaction and CapacityManager abstractions, aligning the codebase with standard CCC (ckb-ccc) patterns. The transition to ccc.TransactionLike for method parameters and ccc.Transaction for return values is thorough and follows the established conventions of the CCC ecosystem. The consolidation of DAO output limit checks into a centralized utility in CCC core is a significant maintainability improvement. The build system enhancements for managing local CCC patches also provide a robust way to handle upstream dependencies during development.
4342ea7 to
d7b2ffa
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This is a substantial and well-executed refactoring that successfully removes the SmartTransaction and CapacityManager abstractions. The changes are consistent across all packages, replacing custom implementations with the upstream ccc library's features, which significantly simplifies the codebase. The migration to the TransactionLike pattern, the inlining of helper functions, and the centralization of the DAO output limit check are all implemented correctly. The documentation and project management files have also been updated to reflect these significant changes. I found no issues in the implementation.
ca2c98b to
3972f5e
Compare
Reorganize into numbered PR workflow steps, add CCC upstream PR instructions, and sync reference repos description with CLAUDE.md.
Set noEmit: true at the root level so type-checking-only invocations (tsgo, IDE) don't accidentally emit files. Packages and apps that need to emit override with noEmit: false in their own tsconfig.
Also fix review findings: - Remove redundant assertDaoOutputLimit in OwnedOwnerManager.withdraw (already called inside daoManager.withdraw; only inputs added after) - Remove dead options reassignment in OwnedOwnerManager.withdraw - Return ccc.Transaction from UdtHandler.completeUdt to avoid silent mutation loss when callers pass a plain TransactionLike object
3972f5e to
3126894
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request successfully removes the SmartTransaction and CapacityManager abstractions in favor of the native ccc.TransactionLike and ccc.Transaction types from the CCC core library. The changes include inlining header management, consolidating DAO output limit checks into a centralized utility in CCC core, and updating method signatures across all packages to follow the CCC convention of accepting TransactionLike and returning Transaction. The build configuration has also been improved with noEmit at the root level. Overall, the refactoring significantly simplifies the codebase and aligns it better with the upstream library.
|
LGTM Phroi %235 |
Why
SmartTransactionandCapacityManagerwere thin wrappers around CCC'sTransactionthat added complexity without meaningful benefit. With the DAO output limit check now upstreamed into CCC core (PR #359), these abstractions are no longer needed.Changes
SmartTransactionandCapacityManagerfrom@ickb/utilsSmartTransactionparameters withccc.TransactionLikeacross all packagesgetHeader/addHeadershelpers and remove from public APIassertDaoOutputLimitin CCC corenoEmitto root tsconfig with per-package overrides