Conversation
- Update Wallet type to include capabilities\n- Modify buildWallet to compute capabilities for Summon, SDK, and Legacy wallets\n- Update hooks (useAppWallet, useMultisigWallet, useWalletBalances) to leverage capabilities\n- Update UI components (CardWallet, ShowInfo) to use capability-driven rendering\n- Add unit tests for Summon wallet capabilities
|
@kanyuku is attempting to deploy a commit to the MeshJS Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi sorry for the slow processing so far can you do the PR to preprod? We are currently setting up a better testing frame work so we can move faster. Will update the contribution guid as well. And thank you very much for your on going contribution. |
QSchlegel
left a comment
There was a problem hiding this comment.
Thanks @kanyuku, the capability refactor lands in the right spot and the unordered-CBOR test for legacy Summon wallets is a nice catch. A few things before we merge:
blocking: rebase onto preprod. Per CONTRIBUTING.md all PRs land on preprod first and graduate to main after a green smoke run. This PR currently targets main.
blocking: non-null assertion on wallet.capabilities!.address in useWalletBalances.ts. capabilities is declared optional on the Wallet type but dereferenced with ! in the hook. Any wallet row constructed outside buildWallet() (older cached records, tests, future code paths) will hit a runtime crash. Either:
- make
capabilitiesnon-optional on theWallettype and guarantee it at every construction site, or - guard the access and fall back to the previous address-resolution path.
question: Summon canVote is hardcoded to false. Is that the correct policy today? If so, please drop a TODO linking the issue that will flip it, so the next person who touches Summon sees it.
nit: run-snapshots-batch.ts dropped ~35 lines of conditional wallet-construction logic in favor of a single buildWallet() call. One sentence of comment explaining that the conditional is now fully subsumed by capabilities would help whoever reads this in six months.
After the rebase, please confirm ci-smoke-preprod is green on the latest head. Happy to take another look once the blocking items are addressed.
Fixed PR feedback regarding legacy Summon wallets: buildWallet now correctly preserves original paymentScriptCbor for backward compatibility with unordered CBOR structures, ensuring address stability. Added robust unit tests to enforce this behavior across API routes.