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

Rename executePoll -> _executePoll + stopPollingByNetworkClientId -> stopPollingByPollingToken #1810

Merged
merged 5 commits into from
Oct 12, 2023

Conversation

adonesky1
Copy link
Contributor

@adonesky1 adonesky1 commented Oct 11, 2023

Fast-follow to #1776, just a few (breaking) naming cleanups

CHANGED

  • BREAKING: executePoll renamed to _executePoll
  • BREAKING: stopPollingByNetworkClientId renamed to stopPollingByPollingToken

shanejonas
shanejonas previously approved these changes Oct 12, 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.

The new names make sense! I just had some suggestions on further communicating that _executePoll is private, and for being consistent internally in treating this method as though it were truly private.

@@ -1294,7 +1294,7 @@ describe('TokenListController', () => {
});
});

describe('executePoll', () => {
describe('_executePoll', () => {
Copy link
Contributor

@mcmire mcmire Oct 12, 2023

Choose a reason for hiding this comment

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

Do we want to keep these tests if we are essentially making this method private? We don't conventionally test private code; we should be able to rename this method now without the tests breaking. Is there some other place we could move these tests to?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed this block and moved the test into the startPollingByNetworkClientId test block: 7a40412

@@ -868,7 +868,7 @@ describe('GasFeeController', () => {
});
});
});
describe('executePoll', () => {
describe('_executePoll', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar for these tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed this block and moved the test into the startPollingByNetworkClientId test block: 7a40412

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, I see the changes for TokenListController, those look great — do we want to do the same for this controller?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry whoops so in that commit I linked I moved some of the logic into the existing startPollingByNetworkClientId test but forgot to remove this block. That removal is done here: b9502fc

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.

LGTM!

@adonesky1 adonesky1 merged commit 0fd4b39 into main Oct 12, 2023
107 checks passed
@adonesky1 adonesky1 deleted the pollingcontroller-cleanups branch October 12, 2023 23:52
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