Skip to content

Commit

Permalink
Update eth-snap-keyring to 0.2.x to use the keyring-api 0.2.x (#2…
Browse files Browse the repository at this point in the history
…0865)

* Update 'eth-snap-keyring' to 0.2.x to use the 'keyring-api' 0.2.x

Note: This PR only affects Flask.

BREAKING CHANGE: The 'keyring-api' 0.2.x is incompatible with the
previous 0.1.x release.

* Update LavaMoat policies

* chore: change SSK url to v0.2.0

* fix: pass `removeAccount` callback to `SnapKeyring`

* chore: update `simple-snap-keyring` URL

* fix: text typo in snap E2E

* fix: remove name input from E2E

* fix: update button name

* chore(deps): bump fast-xml-parser to 4.2.5

* test: update SSK version

* chore: update `yarn.lock` after merge

* Update LavaMoat policies

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Co-authored-by: Gustavo Antunes <17601467+gantunesr@users.noreply.github.com>
Co-authored-by: gantunesr <gustavoantunesrod@gmail.com>
  • Loading branch information
4 people authored Sep 22, 2023
1 parent 0bc3aa9 commit 1e034e0
Show file tree
Hide file tree
Showing 10 changed files with 511 additions and 601 deletions.
3 changes: 3 additions & 0 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,9 @@ export default class MetamaskController extends EventEmitter {
saveState: async () => {
await this.keyringController.persistAllKeyrings();
},
removeAccount: async (address) => {
await this.removeAccount(address);
},
});
builder.type = SnapKeyring.type;
return builder;
Expand Down
165 changes: 61 additions & 104 deletions lavamoat/browserify/beta/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,29 +161,13 @@
},
"packages": {
"@ethereumjs/tx>@ethereumjs/rlp": true,
"@ethereumjs/tx>@ethereumjs/util>ethereum-cryptography": true,
"@ethereumjs/tx>@ethereumjs/util>micro-ftch": true,
"@ethereumjs/tx>ethereum-cryptography": true,
"browserify>buffer": true,
"browserify>insert-module-globals>is-buffer": true,
"webpack>events": true
}
},
"@ethereumjs/tx>@ethereumjs/util>ethereum-cryptography": {
"globals": {
"TextDecoder": true,
"crypto": true
},
"packages": {
"@ethereumjs/tx>@ethereumjs/util>ethereum-cryptography>@noble/hashes": true,
"@ethereumjs/tx>ethereum-cryptography>@noble/curves": true
}
},
"@ethereumjs/tx>@ethereumjs/util>ethereum-cryptography>@noble/hashes": {
"globals": {
"TextEncoder": true,
"crypto": true
}
},
"@ethereumjs/tx>@ethereumjs/util>micro-ftch": {
"globals": {
"Headers": true,
Expand All @@ -208,6 +192,7 @@
"crypto": true
},
"packages": {
"@ethereumjs/tx>ethereum-cryptography>@noble/curves": true,
"@ethereumjs/tx>ethereum-cryptography>@noble/hashes": true
}
},
Expand Down Expand Up @@ -934,29 +919,14 @@
"@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util": {
"packages": {
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": true,
"@ethereumjs/tx>ethereum-cryptography": true,
"bn.js": true,
"browserify>buffer": true,
"eth-sig-util>ethereumjs-util>ethjs-util": true,
"eth-sig-util>tweetnacl": true,
"eth-sig-util>tweetnacl-util": true
}
},
"@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": {
"globals": {
"TextDecoder": true,
"crypto": true
},
"packages": {
"@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true
}
},
"@metamask/eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": {
"globals": {
"TextEncoder": true,
"crypto": true
}
},
"@metamask/eth-json-rpc-middleware>clone": {
"packages": {
"browserify>buffer": true
Expand All @@ -979,7 +949,7 @@
"packages": {
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography": true,
"@metamask/eth-snap-keyring>@metamask/eth-sig-util": true,
"@metamask/eth-trezor-keyring>@metamask/eth-sig-util": true,
"@metamask/scure-bip39": true,
"browserify>buffer": true
}
Expand Down Expand Up @@ -1051,7 +1021,7 @@
"packages": {
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography": true,
"@metamask/eth-snap-keyring>@metamask/eth-sig-util": true,
"@metamask/eth-trezor-keyring>@metamask/eth-sig-util": true,
"browserify>buffer": true,
"mocha>serialize-javascript>randombytes": true,
"webpack>events": true
Expand Down Expand Up @@ -1107,17 +1077,25 @@
},
"@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util": {
"packages": {
"@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethereum-cryptography": true,
"@metamask/ppom-validator>elliptic": true,
"bn.js": true,
"browserify>assert": true,
"browserify>buffer": true,
"eth-sig-util>ethereumjs-util>ethjs-util": true,
"ethereumjs-util>create-hash": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>rlp": true,
"koa>content-disposition>safe-buffer": true
}
},
"@metamask/eth-ledger-bridge-keyring>eth-sig-util>ethereumjs-util>ethereum-cryptography": {
"packages": {
"browserify>buffer": true,
"ethereumjs-util>ethereum-cryptography>keccak": true,
"ethereumjs-util>ethereum-cryptography>secp256k1": true,
"mocha>serialize-javascript>randombytes": true
}
},
"@metamask/eth-ledger-bridge-keyring>hdkey": {
"packages": {
"@metamask/eth-ledger-bridge-keyring>hdkey>secp256k1": true,
Expand All @@ -1137,32 +1115,6 @@
"koa>content-disposition>safe-buffer": true
}
},
"@metamask/eth-snap-keyring>@metamask/eth-sig-util": {
"packages": {
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/eth-snap-keyring>@metamask/eth-sig-util>ethereum-cryptography": true,
"bn.js": true,
"browserify>buffer": true,
"eth-sig-util>ethereumjs-util>ethjs-util": true,
"eth-sig-util>tweetnacl": true,
"eth-sig-util>tweetnacl-util": true
}
},
"@metamask/eth-snap-keyring>@metamask/eth-sig-util>ethereum-cryptography": {
"globals": {
"TextDecoder": true,
"crypto": true
},
"packages": {
"@metamask/eth-snap-keyring>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true
}
},
"@metamask/eth-snap-keyring>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": {
"globals": {
"TextEncoder": true,
"crypto": true
}
},
"@metamask/eth-token-tracker": {
"globals": {
"console.warn": true
Expand Down Expand Up @@ -1292,6 +1244,17 @@
"webpack>events": true
}
},
"@metamask/eth-trezor-keyring>@metamask/eth-sig-util": {
"packages": {
"@ethereumjs/tx>@ethereumjs/util": true,
"@ethereumjs/tx>ethereum-cryptography": true,
"bn.js": true,
"browserify>buffer": true,
"eth-sig-util>ethereumjs-util>ethjs-util": true,
"eth-sig-util>tweetnacl": true,
"eth-sig-util>tweetnacl-util": true
}
},
"@metamask/eth-trezor-keyring>@metamask/utils": {
"globals": {
"TextDecoder": true,
Expand All @@ -1306,7 +1269,7 @@
},
"@metamask/eth-trezor-keyring>@trezor/connect-plugin-ethereum": {
"packages": {
"@metamask/eth-snap-keyring>@metamask/eth-sig-util": true
"@metamask/eth-trezor-keyring>@metamask/eth-sig-util": true
}
},
"@metamask/eth-trezor-keyring>@trezor/connect-web": {
Expand Down Expand Up @@ -1567,29 +1530,14 @@
"@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util": {
"packages": {
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": true,
"@ethereumjs/tx>ethereum-cryptography": true,
"bn.js": true,
"browserify>buffer": true,
"eth-sig-util>ethereumjs-util>ethjs-util": true,
"eth-sig-util>tweetnacl": true,
"eth-sig-util>tweetnacl-util": true
}
},
"@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": {
"globals": {
"TextDecoder": true,
"crypto": true
},
"packages": {
"@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true
}
},
"@metamask/keyring-controller>@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": {
"globals": {
"TextEncoder": true,
"crypto": true
}
},
"@metamask/keyring-controller>@metamask/utils": {
"globals": {
"TextDecoder": true,
Expand All @@ -1605,26 +1553,39 @@
},
"@metamask/keyring-controller>ethereumjs-wallet": {
"packages": {
"@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography": true,
"@metamask/keyring-controller>ethereumjs-wallet>ethereumjs-util": true,
"@truffle/codec>utf8": true,
"browserify>buffer": true,
"browserify>crypto-browserify": true,
"eth-lattice-keyring>gridplus-sdk>aes-js": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>ethereum-cryptography>bs58check": true,
"ethereumjs-util>ethereum-cryptography>scrypt-js": true,
"mocha>serialize-javascript>randombytes": true,
"uuid": true
}
},
"@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography": {
"packages": {
"browserify>assert": true,
"browserify>buffer": true,
"browserify>crypto-browserify>create-hmac": true,
"ethereumjs-util>ethereum-cryptography>bs58check": true,
"ethereumjs-util>ethereum-cryptography>hash.js": true,
"ethereumjs-util>ethereum-cryptography>keccak": true,
"ethereumjs-util>ethereum-cryptography>secp256k1": true,
"koa>content-disposition>safe-buffer": true,
"mocha>serialize-javascript>randombytes": true
}
},
"@metamask/keyring-controller>ethereumjs-wallet>ethereumjs-util": {
"packages": {
"@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography": true,
"bn.js": true,
"browserify>assert": true,
"browserify>buffer": true,
"browserify>insert-module-globals>is-buffer": true,
"ethereumjs-util>create-hash": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>rlp": true
}
},
Expand Down Expand Up @@ -1663,29 +1624,14 @@
"@metamask/message-manager>@metamask/eth-sig-util": {
"packages": {
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/message-manager>@metamask/eth-sig-util>ethereum-cryptography": true,
"@ethereumjs/tx>ethereum-cryptography": true,
"bn.js": true,
"browserify>buffer": true,
"eth-sig-util>ethereumjs-util>ethjs-util": true,
"eth-sig-util>tweetnacl": true,
"eth-sig-util>tweetnacl-util": true
}
},
"@metamask/message-manager>@metamask/eth-sig-util>ethereum-cryptography": {
"globals": {
"TextDecoder": true,
"crypto": true
},
"packages": {
"@metamask/message-manager>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true
}
},
"@metamask/message-manager>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": {
"globals": {
"TextEncoder": true,
"crypto": true
}
},
"@metamask/message-manager>jsonschema": {
"packages": {
"browserify>url": true
Expand Down Expand Up @@ -3602,13 +3548,21 @@
"bn.js": true,
"browserify>assert": true,
"browserify>buffer": true,
"eth-sig-util>ethereumjs-util>ethereum-cryptography": true,
"eth-sig-util>ethereumjs-util>ethjs-util": true,
"ethereumjs-util>create-hash": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>rlp": true,
"koa>content-disposition>safe-buffer": true
}
},
"eth-sig-util>ethereumjs-util>ethereum-cryptography": {
"packages": {
"browserify>buffer": true,
"ethereumjs-util>ethereum-cryptography>keccak": true,
"ethereumjs-util>ethereum-cryptography>secp256k1": true,
"mocha>serialize-javascript>randombytes": true
}
},
"eth-sig-util>ethereumjs-util>ethjs-util": {
"packages": {
"browserify>buffer": true,
Expand Down Expand Up @@ -3649,11 +3603,19 @@
"browserify>assert": true,
"browserify>buffer": true,
"eth-sig-util>ethereumjs-util>ethjs-util": true,
"ethereumjs-abi>ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>create-hash": true,
"ethereumjs-util>ethereum-cryptography": true,
"ethereumjs-util>rlp": true
}
},
"ethereumjs-abi>ethereumjs-util>ethereum-cryptography": {
"packages": {
"browserify>buffer": true,
"ethereumjs-util>ethereum-cryptography>keccak": true,
"ethereumjs-util>ethereum-cryptography>secp256k1": true,
"mocha>serialize-javascript>randombytes": true
}
},
"ethereumjs-util": {
"packages": {
"bn.js": true,
Expand Down Expand Up @@ -3716,14 +3678,9 @@
},
"ethereumjs-util>ethereum-cryptography": {
"packages": {
"browserify>assert": true,
"browserify>buffer": true,
"browserify>crypto-browserify>create-hmac": true,
"ethereumjs-util>ethereum-cryptography>bs58check": true,
"ethereumjs-util>ethereum-cryptography>hash.js": true,
"ethereumjs-util>ethereum-cryptography>keccak": true,
"ethereumjs-util>ethereum-cryptography>secp256k1": true,
"koa>content-disposition>safe-buffer": true,
"mocha>serialize-javascript>randombytes": true
}
},
Expand Down
Loading

0 comments on commit 1e034e0

Please sign in to comment.