Conversation
d8926ef to
010ce60
Compare
8b2387c to
2e23109
Compare
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
7bb3882 to
debd7eb
Compare
|
@metamaskbot publish-preview |
debd7eb to
e31c503
Compare
|
@metamaskbot publish-preview |
|
No dependency changes detected. Learn more about Socket for GitHub. 👍 No dependency changes detected in pull request |
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
178d32d to
a820fad
Compare
9fac52d to
3ad67f2
Compare
320839f to
e0cc75e
Compare
Each step now checks persisted state via #isStepCompleted before running, so a retry after a mid-sequence failure resumes from the last incomplete step rather than re-running everything from scratch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Moves ROOT_AUTHORITY, MAX_UINT256, and STEP_ORDER into constants.ts, and the inline #encodeCaveatTerms private method into a standalone encode-caveat-terms.ts module with direct unit tests. First step in splitting up the growing MoneyAccountUpgradeController file. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Introduces src/steps/ with a StepContext/StepResult/Step type scaffold and a #runStep orchestration helper on the controller that handles the skip check, context build, and state patch merge. The associate-address step is the first extracted — direct unit tests cover its behavior, and the corresponding describe block is removed from the controller tests since orchestration is already covered by the resumability tests. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Introduce a Step type ({ name, run }) with a StepResult union
('already-done' | 'completed') and iterate an internal steps array from
upgradeAccount. Errors from a step propagate and halt the sequence.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Implements step 0 of the Money Account upgrade: signs a fresh
"CHOMP Authentication {timestamp}" message via KeyringController and
submits it to ChompApiService.associateAddress. The endpoint is
idempotent, so the step has no pre-check and always returns 'completed'.
upgradeAccount now takes the account address as a parameter and passes
a { messenger, address } context to each step.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
67bcc7c to
07a2265
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 07a2265. Configure here.
| async upgradeAccount(address: Hex): Promise<void> { | ||
| for (const step of this.#steps) { | ||
| await step.run({ messenger: this.messenger, address }); | ||
| } |
There was a problem hiding this comment.
init result discarded, initialized flag never enforced
Low Severity
The init method fetches and validates service details, sets this.initialized = true, but upgradeAccount never checks the initialized flag before running steps. The initialized property is assigned in the constructor and in init but never read anywhere in the controller's production code — only in tests. This makes it dead code within the controller and means the chain validation performed by init is entirely unenforced; callers can invoke upgradeAccount without init, bypassing all validation.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 07a2265. Configure here.


Explanation
This PR adds a scaffold for the money account upgrade controller, as well the first step in the upgrade process.
I'll make follow up PRs adding the further steps so they can be reviewed more easily.
Addresses
MUSD-447 and MUSD-449
References
Checklist