Skip to content
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

Tokens controller approve reject refactor #1261

Merged
merged 4 commits into from
May 11, 2023

Conversation

bergarces
Copy link
Contributor

@bergarces bergarces commented Apr 24, 2023

Description

Stops triggering the acceptance or rejection of the approval from within TokensController. That'll be the responsibility of the caller.

This is part of a series of tickets that aim to refactor and simplify how we await for the confirmation promise.

Changes

  • BREAKING: Remove acceptance and rejection of the approval from within TokensController

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation for new or updated code as appropriate (note: this will usually be JSDoc)
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@bergarces bergarces force-pushed the tokens-controller-approve-reject-refactor branch from 602ba37 to 308856f Compare May 4, 2023 19:13
@@ -74,7 +70,7 @@ export type SuggestedAssetMetaBase = {
time: number;
type: string;
asset: Token;
interactingAddress?: string;
interactingAddress: string;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only place where this object is created is in the method watchAsset and it uses:

interactingAddress: interactingAddress || selectedAddress

The value of selectedAddress is defined as a string, not string | undefined, so this value is never undefined.

@@ -670,12 +663,10 @@ export class TokensController extends BaseController<
): Promise<AssetSuggestionResult> {
const { selectedAddress } = this.config;

const suggestedAssetMeta: SuggestedAssetMeta & {
interactingAddress: string;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No need to force this into the type anymore due to the type change.

@bergarces bergarces marked this pull request as ready for review May 4, 2023 20:32
@bergarces bergarces requested a review from a team as a code owner May 4, 2023 20:32
@bergarces bergarces merged commit 6a728bc into main May 11, 2023
@bergarces bergarces deleted the tokens-controller-approve-reject-refactor branch May 11, 2023 07:56
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
* stops calling approve and reject from controller
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
* stops calling approve and reject from controller
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants