-
-
Notifications
You must be signed in to change notification settings - Fork 261
Frequent RPC list #20
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #20 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 18 18
Lines 872 889 +17
Branches 93 97 +4
=====================================
+ Hits 872 889 +17
Continue to review full report at Codecov.
|
bitpshr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
This commit introduces logging via the `debug` library. One key feature
of this library is that it allows you to assign a label to log messages.
All log messages are suppressed and will not be shown by default, but
the label you choose can be namespaced, and you can use these namespaces
to selectively show the log messages you're interested in.
With that in mind this commit defines at least two logging namespaces: a
global `metamask` namespace for all projects that need logging and a
project-level namespace.
The way it works is this. Say your project is called
`eth-block-tracker`. To add logging to your project, you'd add a file
(call it `logging-utils.ts`) which contains:
import { createProjectLogger } from "@metamask/utils";
export const projectLogger = createProjectLogger("eth-block-tracker");
You could either use `projectLogger` anywhere in your project like this:
import { projectLogger as log } from "./logging-utils";
log("This is a log message");
Then you could run your tests, or whatever command you want to run, by
setting the `DEBUG` environment variable like this:
DEBUG=metamask:eth-block-tracker <command goes here>
And in the output you'd see something like:
metamask:eth-block-tracker This is a log message +0ms
However if you wanted to namespace your log messages further — say you
wanted to only show log messages for a `polling-block-tracker.ts` file —
you could update `logging-utils.ts` like this:
import { createProjectLogger, createModuleLogger } from "@metamask/utils";
export const projectLogger = createProjectLogger("eth-block-tracker");
export { createModuleLogger };
Then add the following to `polling-block-tracker.ts`:
import { projectLogger, createModuleLogger } from "./logging-utils";
const log = createModuleLogger(projectLogger, "polling-block-tracker");
log("This is a log message");
Now you could run your command with:
DEBUG=metamask:eth-block-tracker:polling-block-tracker <command goes here>
or, for all `eth-block-tracker` log messages:
DEBUG=metamask:eth-block-tracker:* <command goes here>
And in the output you'd see something like:
metamask:eth-block-tracker:polling-block-message This is a log message +0ms
Finally if you wanted to show all log messages across all MetaMask
projects that are also making use of this logging mechanism, you could
say:
DEBUG=metamask:* <command goes here>
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7. - [Release notes](https://github.com/jbgutierrez/path-parse/releases) - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7) --- updated-dependencies: - dependency-name: path-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Required by update of `@metamask/json-rpc-engine` (#16)
* correctly implement ordered batch calls * update errors for consistency
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7. - [Release notes](https://github.com/jbgutierrez/path-parse/releases) - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7) --- updated-dependencies: - dependency-name: path-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7. - [Release notes](https://github.com/jbgutierrez/path-parse/releases) - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7) --- updated-dependencies: - dependency-name: path-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7. - [Release notes](https://github.com/jbgutierrez/path-parse/releases) - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7) --- updated-dependencies: - dependency-name: path-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This happens when using 1. eth-json-rpc-errors@2.0.0 with eth-json-rpc-middleware@4.4.0 2. eth-json-rpc-errors@1.1.0 with eth-json-rpc-middleware@4.4.0 This won't happens when using eth-json-rpc-errors@1.1.0 with eth-json-rpc-middleware@4.2.0 Check comment bellow for more detail MetaMask/metamask-extension#7286 (comment)
This PR adds a list of frequent RPC urls in
PreferencesController, with the objective of adding custom RPC urls.