-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add RCATs to wallet #19795
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
Add RCATs to wallet #19795
Conversation
Pull Request Test Coverage Report for Build 16204290850Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds support for Revocable CATs by introducing a new RCATWallet
subclass and integrating it across wallet state management, puzzle drivers, and tests.
- Introduce
WalletType.RCAT
and registerRCATWallet
in state manager and asset‐id lookups - Implement
RevocationOuterPuzzle
driver and extendget_inner_puzzle
signatures project‐wide - Parameterize existing CAT tests to run against both
CATWallet
andRCATWallet
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
chia/wallet/wallet_state_manager.py | Import and handle RCATWallet in creation, handle_cat , and get_wallet_for_asset_id |
chia/wallet/vc_wallet/vc_drivers.py | Add RevocationOuterPuzzle with new match/construct/solve logic |
chia/wallet/outer_puzzles.py | Register RevocationOuterPuzzle under new AssetType.REVOCATION_LAYER |
chia/wallet/driver_protocol.py | Update get_inner_puzzle signature to accept optional solution argument |
chia/wallet/cat_wallet/.py & chia/wallet/vc_wallet/.py & nft_wallet/*.py | Update driver method signatures (get_inner_puzzle ) to include solution: Optional[Program] |
chia/wallet/cat_wallet/r_cat_wallet.py | New RCATWallet implementation inheriting from CATWallet |
chia/_tests/wallet/cat_wallet/*.py | Parameterize tests to run for both CATWallet and RCATWallet |
Comments suppressed due to low confidence (5)
chia/wallet/wallet_state_manager.py:331
- The RCAT creation branch is marked
# pragma: no cover
, so it isn't exercised by tests—either add tests for this path or remove the pragma.
elif wallet_type == WalletType.RCAT: # pragma: no cover
chia/wallet/driver_protocol.py:16
- [nitpick] Consider giving the
solution
parameter a default ofNone
in the Protocol signature so that implementations with an optionalsolution
parameter align cleanly.
def get_inner_puzzle(
chia/wallet/wallet_state_manager.py:1138
- [nitpick] Remove placeholder debug logs (
HERE
,HERE2
, etc.) or replace them with meaningful log messages at an appropriate log level.
self.log.error(f"HERE")
chia/wallet/vc_wallet/vc_drivers.py:26
- Import
Any
from the standardtyping
module instead oftyping_extensions
to avoid import errors; keepSelf
fromtyping_extensions
if needed.
from typing_extensions import Any, Self
chia/wallet/trading/offer.py:238
- Ensure that
parent_solution
is defined in this scope (or correctly named) before passing it toget_inner_puzzle
, otherwise this will raise aNameError
.
inner_puzzle: Optional[Program] = get_inner_puzzle(puzzle_driver, parent_puzzle, parent_solution)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here's a quick pass without digging into an understanding of the way the revocable cat works or details around any special wallet tracking needs or... i did diff the new subclass against the parent to compare what was overridden and that it looked kinda ok'ish.
for the less localized inheritance related tweaks, i expect to withdraw them. but, i had already typed them up so will submit them and we can let you see some possibilities here, then i'll close them.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code coverage exemption
This PR adds support for Revocable CATs to the wallet. It ended up being a thin modification of the base
CATWallet
class via inheritance.In the tests, there is an unfortunate addition of an
Any
which is sort of necessary because of how the method it's relevant to needs to be refactored.