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

add rollbackToPreviousProvider method #1132

Merged
merged 3 commits into from
Mar 22, 2023

Conversation

adonesky1
Copy link
Contributor

  • ADDED:

    • adds a rollbackToPreviousProvider method like the one that exists on the extension side NetworkController

Resolves #1024

@adonesky1 adonesky1 force-pushed the add-rollback-to-previous-provider branch 2 times, most recently from 3492ae6 to ae2603d Compare March 16, 2023 16:22
@adonesky1 adonesky1 marked this pull request as ready for review March 16, 2023 16:23
@adonesky1 adonesky1 requested a review from a team as a code owner March 16, 2023 16:23
@adonesky1 adonesky1 force-pushed the migrate-network-configs-to-network-controller branch 3 times, most recently from f659097 to 479e349 Compare March 16, 2023 22:59
@adonesky1 adonesky1 force-pushed the add-rollback-to-previous-provider branch 5 times, most recently from cc23734 to b0f9743 Compare March 17, 2023 22:54
Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

This is looking good! Just a few comments

@@ -911,7 +910,7 @@ export class NftController extends BaseController<NftConfig, NftState> {
) {
super(config, state);
this.defaultConfig = {
networkType: MAINNET,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! Yeah this is much better.

rpc = 'rpc',
}

export const isNetworkType = (val: any): val is NetworkType => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Thoughts on making this a function instead of a const? I believe this will enforce that this is JSDoc'd as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done here: 19c536a

packages/controller-utils/jest.config.js Outdated Show resolved Hide resolved
@adonesky1 adonesky1 marked this pull request as draft March 20, 2023 18:04
@adonesky1 adonesky1 force-pushed the add-rollback-to-previous-provider branch from ceb710d to 49b5222 Compare March 21, 2023 14:35
@adonesky1 adonesky1 marked this pull request as ready for review March 21, 2023 18:23
@adonesky1 adonesky1 requested a review from mcmire March 21, 2023 18:23
mcmire
mcmire previously approved these changes Mar 21, 2023
Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

This looks great!

@adonesky1
Copy link
Contributor Author

@mcmire thank you for the reviews! Since this is PR based on #1064 I'm going to wait til that merges to merge this!

Base automatically changed from migrate-network-configs-to-network-controller to main March 22, 2023 19:38
Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

One small thing, but other than that, good to go.

@@ -1,5 +1,6 @@
/* eslint-disable jest/require-top-level-describe, jest/no-export, jest/no-identical-title, jest/no-if */

import { NetworkType } from '@metamask/controller-utils/src';
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we exporting this type from controller-utils? If so, I think we can drop the /src.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh... weird not sure how that happened!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed here: da27c40

Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Looks good!

@adonesky1 adonesky1 merged commit 99df8b5 into main Mar 22, 2023
@adonesky1 adonesky1 deleted the add-rollback-to-previous-provider branch March 22, 2023 21:28
@legobeat legobeat mentioned this pull request Apr 25, 2023
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
* add rollbackToPreviousProvider method
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
* add rollbackToPreviousProvider method
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.

NetworkController API normalization: Add rollbackToPreviousProvider method.
2 participants