-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow createInfuraMiddleware to take an RPC service
`@metamask/network-controller` now contains an `RpcService` class. Using this class not only allows us to remove a lot of code from this package, as it incorporates the vast majority of logic contained in `createInfuraMiddleware`, including the retry logic, but it also allows us to use the circuit breaker pattern and the exponential backoff pattern to prevent too many retries if the network is unreliable, and then automatically cut over to a failover node when the network truly goes down.
- Loading branch information
Showing
9 changed files
with
1,199 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,8 @@ | |
"lint:misc": "prettier '**/*.json' '**/*.md' '!CHANGELOG.md' '**/*.yml' --ignore-path .gitignore --no-error-on-unmatched-pattern", | ||
"prepublishOnly": "yarn build:clean && yarn lint && yarn test", | ||
"setup": "yarn install && yarn allow-scripts", | ||
"test": "jest", | ||
"test": "jest && yarn build:clean && yarn test:types", | ||
"test:types": "tsd --files 'src/**/*.test-d.ts'", | ||
"test:watch": "jest --watch" | ||
}, | ||
"dependencies": { | ||
|
@@ -31,12 +32,14 @@ | |
"@metamask/utils": "^11.0.1" | ||
}, | ||
"devDependencies": { | ||
"@babel/runtime": "^7.0.0", | ||
"@lavamoat/allow-scripts": "^2.3.1", | ||
"@metamask/auto-changelog": "^2.5.0", | ||
"@metamask/eslint-config": "^12.2.0", | ||
"@metamask/eslint-config-jest": "^12.1.0", | ||
"@metamask/eslint-config-nodejs": "^12.1.0", | ||
"@metamask/eslint-config-typescript": "^12.1.0", | ||
"@metamask/network-controller": "22.2.0", | ||
"@types/jest": "^26.0.13", | ||
"@types/node": "^18.18.14", | ||
"@typescript-eslint/eslint-plugin": "^5.42.1", | ||
|
@@ -56,8 +59,10 @@ | |
"rimraf": "^3.0.2", | ||
"ts-jest": "^28.0.8", | ||
"ts-node": "^10.7.0", | ||
"tsd": "^0.31.2", | ||
"typescript": "~4.8.4" | ||
}, | ||
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e", | ||
"engines": { | ||
"node": "^18.18 || ^20.14 || >=22" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.