-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify protocol name detection (#317)
Simplify protocol name detection by using the `snaps-utils` implementation. This makes the names chosen match the clients. To bring in `snaps-utils` I had to make changes the Webpack configuration and Jest because of the additional dependencies introduced. All polyfills are intentionally turned off to not bloat the bundle. Closes #304
- Loading branch information
1 parent
2269694
commit 7d8f943
Showing
14 changed files
with
208 additions
and
137 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* eslint-disable */ | ||
const { TestEnvironment } = require('jest-environment-jsdom'); | ||
|
||
// Custom test environment copied from https://github.com/jsdom/jsdom/issues/2524 | ||
// in order to add TextEncoder to jsdom. TextEncoder is expected by jose. | ||
|
||
module.exports = class CustomTestEnvironment extends TestEnvironment { | ||
async setup() { | ||
await super.setup(); | ||
if (typeof this.global.TextEncoder === 'undefined') { | ||
const { TextEncoder, TextDecoder } = require('util'); | ||
this.global.TextEncoder = TextEncoder; | ||
this.global.TextDecoder = TextDecoder; | ||
this.global.ArrayBuffer = ArrayBuffer; | ||
this.global.Uint8Array = Uint8Array; | ||
} | ||
} | ||
}; |
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 |
---|---|---|
|
@@ -61,9 +61,9 @@ | |
"@lingui/react": "^4.4.2", | ||
"@metamask/logo": "^3.1.1", | ||
"@metamask/providers": "^14.0.0", | ||
"@metamask/slip44": "^3.1.0", | ||
"@metamask/snaps-controllers": "^5.0.0", | ||
"@metamask/snaps-sdk": "^2.0.0", | ||
"@metamask/snaps-controllers": "^6.0.0", | ||
"@metamask/snaps-sdk": "^3.0.0", | ||
"@metamask/snaps-utils": "^7.0.0", | ||
"@metamask/utils": "^8.1.0", | ||
"@reduxjs/toolkit": "^1.9.6", | ||
"framer-motion": "^10.16.2", | ||
|
@@ -94,7 +94,6 @@ | |
"@metamask/eslint-config-nodejs": "^12.0.0", | ||
"@metamask/eslint-config-typescript": "^12.0.0", | ||
"@metamask/snaps-registry": "^3.0.0", | ||
"@metamask/snaps-utils": "^6.0.0", | ||
"@svgr/webpack": "^8.1.0", | ||
"@testing-library/jest-dom": "^6.1.3", | ||
"@testing-library/react": "^14.0.0", | ||
|
@@ -136,12 +135,14 @@ | |
"jest-when": "^3.6.0", | ||
"jimp": "^0.22.10", | ||
"lint-staged": "^14.0.1", | ||
"nanoid": "^3.3.7", | ||
"node-fetch-cache": "^3.1.3", | ||
"prettier": "^2.7.1", | ||
"prettier-plugin-packagejson": "^2.3.0", | ||
"sharp": "^0.32.5", | ||
"simple-git-hooks": "^2.9.0", | ||
"typescript": "~4.8.4" | ||
"typescript": "~4.8.4", | ||
"webpack": "^5.90.3" | ||
}, | ||
"packageManager": "[email protected]", | ||
"engines": { | ||
|
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
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
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
Oops, something went wrong.