Skip to content

Sj/caip 25 poc mutator#25643

Merged
shanejonas merged 5 commits intojl/mmp-2360/caip-25-pocfrom
sj/caip-25-poc-mutator
Jul 3, 2024
Merged

Sj/caip 25 poc mutator#25643
shanejonas merged 5 commits intojl/mmp-2360/caip-25-pocfrom
sj/caip-25-poc-mutator

Conversation

@shanejonas
Copy link
Copy Markdown
Contributor

@shanejonas shanejonas commented Jul 2, 2024

Description

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@shanejonas shanejonas requested a review from a team as a code owner July 2, 2024 21:10
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 2, 2024

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-wallet-api-platform-deprecated DEPRECATED: please use "team-wallet-integrations" instead label Jul 2, 2024
Comment on lines +120 to +127
return {
operation: CaveatMutatorOperation.updateValue,
value: {
requiredScopes: newRequiredScopes.reduce(reduceKeysHelper, {}),
optionalScopes: newOptionalScopes.reduce(reduceKeysHelper, {}),
},
};
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to update mergedScopes too, but i'm starting to question if mergedScopes needs to exist in the caveat now

};
}

if (!requiredScopesRemoved && !optionalScopesRemoved) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guard not necessary

};
}

if (!requiredScopesRemoved && optionalScopesRemoved) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!requiredScopesRemoved && optionalScopesRemoved) {
if (optionalScopesRemoved) {

const optionalScopesRemoved =
newOptionalScopes.length !== Object.entries(existingScopes.optionalScopes).length;

if (requiredScopesRemoved) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can probably just be a check for existingScopes.requiredScopes[targetScopeString]? nit i suppose

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ill leave this in in case we need to support removing multiple scopes at some point

@shanejonas shanejonas merged commit af260a5 into jl/mmp-2360/caip-25-poc Jul 3, 2024
@shanejonas shanejonas deleted the sj/caip-25-poc-mutator branch July 3, 2024 16:31
@github-actions github-actions bot locked and limited conversation to collaborators Jul 3, 2024
@shanejonas shanejonas restored the sj/caip-25-poc-mutator branch July 3, 2024 17:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

team-wallet-api-platform-deprecated DEPRECATED: please use "team-wallet-integrations" instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants