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

Multichain E2E Test: Multi dapp #29751

Open
wants to merge 863 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
863 commits
Select commit Hold shift + click to select a range
7af8dbb
Jl/caip25 permission migration/bind origin to method hooks (#29174)
jiexi Dec 12, 2024
9c33415
Implement Wallet Discovery For Multichain API #2970 (#29111)
ffmcgee725 Dec 13, 2024
c6ab79e
Jl/caip multichain/flask (#29003)
jiexi Dec 13, 2024
82aab64
dedupe
adonesky1 Dec 13, 2024
f83d418
Update app/scripts/migrations/135.ts
jiexi Dec 13, 2024
5dad0aa
Merge branch 'main' into caip25-permission-migration
jiexi Dec 13, 2024
e274301
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Dec 13, 2024
886ec3c
fix flask build
adonesky1 Dec 13, 2024
a86e802
Merge branch 'main' into caip25-permission-migration
jiexi Dec 16, 2024
6573d05
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Dec 16, 2024
73e026a
Merge remote-tracking branch 'origin/jl/caip-multichain-migrate-core'…
jiexi Dec 16, 2024
e389bc2
dedupe
jiexi Dec 16, 2024
ad3eb1b
Merge branch 'main' into caip25-permission-migration
jiexi Dec 16, 2024
32c380d
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Dec 16, 2024
18af503
Merge branch 'main' into caip25-permission-migration
jiexi Dec 16, 2024
f4845a7
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Dec 16, 2024
d000725
feat: Move CAIP-25 permission validation logic into caveat validator …
jiexi Dec 16, 2024
b75e6de
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Dec 16, 2024
ff3b272
Jl/caip25 permission migration/move request grant hooks into mmc (#29…
jiexi Dec 17, 2024
ce9e79b
chore: bump @metamask/providers
ffmcgee725 Dec 17, 2024
9dd6ee2
Update app/scripts/lib/rpc-method-middleware/createMethodMiddleware.js
jiexi Dec 17, 2024
40c3e7e
Merge branch 'main' into caip25-permission-migration
jiexi Dec 17, 2024
a82ae4c
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Dec 17, 2024
9215ba4
move comment block to right before requestEthereumAccountsHandler
jiexi Dec 17, 2024
d28618b
add jsdoc to requestEthereumAccountsHandler
jiexi Dec 17, 2024
a587ed7
Merge branch 'main' into caip25-permission-migration
jiexi Dec 17, 2024
aec2470
Merge branch 'main' into caip25-permission-migration
jiexi Dec 17, 2024
543c24d
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Dec 17, 2024
3d173a3
Merge remote-tracking branch 'origin/jl/caip-multichain-migrate-core'…
jiexi Dec 17, 2024
953c127
fix connectAccount public address usage from upstream
jiexi Dec 17, 2024
cf7c328
Merge branch 'main' into caip25-permission-migration
jiexi Dec 17, 2024
d20da17
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Dec 17, 2024
0c97ce9
fix testDapp.connectAccount usage
jiexi Dec 17, 2024
76ba552
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Dec 17, 2024
5d22667
Merge branch 'main' into caip25-permission-migration
jiexi Dec 17, 2024
09b84e6
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Dec 17, 2024
f2f0dbd
Merge branch 'main' into caip25-permission-migration
jiexi Dec 18, 2024
60d02c9
Update LavaMoat policies
metamaskbot Dec 18, 2024
2657bfe
fix validateChainId guard
jiexi Dec 18, 2024
88b1bd1
Merge branch 'main' into caip25-permission-migration
jiexi Dec 18, 2024
059ecad
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Dec 18, 2024
8e5831e
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Dec 18, 2024
f98f807
Update LavaMoat policies
metamaskbot Dec 18, 2024
3222176
dedupe
adonesky1 Dec 18, 2024
6662dd3
Update app/scripts/metamask-controller.js
jiexi Dec 19, 2024
cb4126d
Merge branch 'main' into caip25-permission-migration
jiexi Dec 19, 2024
0ede8b6
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Dec 19, 2024
08178b5
Merge remote-tracking branch 'origin/jl/caip-multichain-migrate-core'…
jiexi Dec 19, 2024
85d0e94
Merge branch 'main' into caip25-permission-migration
jiexi Dec 19, 2024
ca85516
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Dec 19, 2024
069a8a7
Merge remote-tracking branch 'origin/jl/caip-multichain-migrate-core'…
jiexi Dec 19, 2024
2c40696
convert getDescriptionNode params to object params
jiexi Dec 19, 2024
10ad69f
Merge branch 'main' into caip25-permission-migration
jiexi Dec 19, 2024
a8f4b55
Update wallet_requestPermissions to handle other permissions again
jiexi Dec 19, 2024
f460b5c
Fix Snaps permission UI
jiexi Dec 19, 2024
8ac50a4
incremental permitted chains view still needed
jiexi Dec 19, 2024
ca74a5d
replace updatedCaveatValue let assignment with const
jiexi Dec 19, 2024
a7ba043
fix wallet_requestPermissions e2e spec
jiexi Dec 20, 2024
8953a07
Merge branch 'main' into caip25-permission-migration
jiexi Dec 20, 2024
eb08761
remove incremental redirect for permittedChains
jiexi Dec 20, 2024
352f964
Merge branch 'main' into caip25-permission-migration
jiexi Dec 20, 2024
0048c4d
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Dec 20, 2024
9657527
Merge branch 'main' into caip25-permission-migration
jiexi Dec 20, 2024
f478911
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Dec 20, 2024
0ab7368
Merge branch 'main' into caip25-permission-migration
jiexi Dec 20, 2024
fc4a801
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Dec 20, 2024
e749a8a
Merge branch 'main' into caip25-permission-migration
jiexi Dec 20, 2024
a44b9e7
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Dec 20, 2024
d8fab7f
Merge branch 'main' into caip25-permission-migration
jiexi Jan 6, 2025
e757ab8
use updated preview
jiexi Jan 6, 2025
af5ae95
Merge branch 'main' into caip25-permission-migration
jiexi Jan 6, 2025
42f2386
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Jan 6, 2025
afc2629
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Jan 6, 2025
43e2e3a
Fix wallet_createSession use getSupportedScopeObjects
jiexi Jan 6, 2025
babf3b8
Add back requestPermissionApprovalForOrigin to MMC. Use in requestApp…
jiexi Jan 6, 2025
9d8b687
Rename requestPermissionApprovalForOrigin to requestPermissionApprova…
jiexi Jan 6, 2025
432fcf8
yarn audit
jiexi Jan 6, 2025
add8328
Update LavaMoat policies
metamaskbot Jan 6, 2025
e66e970
Merge branch 'main' into caip25-permission-migration
jiexi Jan 6, 2025
2071366
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Jan 6, 2025
ffef7ae
First Multichain API e2e Test (#29209)
adonesky1 Jan 6, 2025
aec0472
Merge branch 'main' into caip25-permission-migration
jiexi Jan 7, 2025
8a2203c
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Jan 7, 2025
7a13bcc
Merge remote-tracking branch 'origin/jl/caip-multichain-migrate-core'…
jiexi Jan 7, 2025
f4af744
Revert "Rename requestPermissionApprovalForOrigin to requestPermissio…
jiexi Jan 7, 2025
b991c19
Use requestPermissionApproval again
jiexi Jan 7, 2025
2d747f4
DRY background-api getCaip25Caveat
jiexi Jan 7, 2025
bd77c86
Update app/scripts/metamask-controller.js
jiexi Jan 7, 2025
21cbc47
capitalize Snaps in thrown error
jiexi Jan 7, 2025
082a39a
Merge branch 'main' into caip25-permission-migration
jiexi Jan 7, 2025
20b2245
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Jan 7, 2025
d6dfd27
use isSnapId in background-api
jiexi Jan 7, 2025
d2a2d44
jsdoc handlers
jiexi Jan 7, 2025
cd0e2d1
Merge branch 'main' into caip25-permission-migration
jiexi Jan 7, 2025
d3d5f9b
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Jan 7, 2025
0b044e4
Jl/fix api specs multichain (#29487)
jiexi Jan 7, 2025
3f87444
Update app/scripts/metamask-controller.js
jiexi Jan 7, 2025
1ef2033
replace parseInt with hexToBigInt
jiexi Jan 8, 2025
b9e61e0
Merge branch 'main' into caip25-permission-migration
jiexi Jan 8, 2025
eee52ec
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Jan 8, 2025
fb2c400
Merge remote-tracking branch 'origin/jl/caip-multichain-migrate-core'…
jiexi Jan 8, 2025
2e1be33
fix bad merge. lint
jiexi Jan 8, 2025
52e6ea2
Merge branch 'main' into caip25-permission-migration
jiexi Jan 8, 2025
8b06c2c
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Jan 8, 2025
132e784
Merge branch 'main' into caip25-permission-migration
jiexi Jan 8, 2025
b1c0b07
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Jan 8, 2025
097ef14
Fix wallet_requestPermissions approval ordering
jiexi Jan 8, 2025
75814f4
Jl/caip multichain/add api specs wallet create session (#29592)
jiexi Jan 8, 2025
43a5aad
Merge branch 'main' into caip25-permission-migration
jiexi Jan 9, 2025
9a42c67
Merge branch 'main' into caip25-permission-migration
jiexi Jan 9, 2025
368fccb
Jl/caip25 permission migration/fix wallet request permissions delay g…
jiexi Jan 9, 2025
60b4a0b
move cannot derive ethAccounts comment to ethAccounts var assignment
jiexi Jan 9, 2025
553f83e
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Jan 9, 2025
094abb3
Update app/scripts/lib/rpc-method-middleware/handlers/wallet-revokePe…
jiexi Jan 9, 2025
51dc9d3
add ignoreLock options object to getPermittedAccounts
jiexi Jan 9, 2025
9f2422e
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Jan 9, 2025
8a3bc99
remove isMultichainOrigin checks in add/switchEthereumChain and revok…
jiexi Jan 9, 2025
30b1773
Convert request-accounts.ts back to js
jiexi Jan 9, 2025
85782c5
Merge branch 'main' into caip25-permission-migration
jiexi Jan 10, 2025
9542e9c
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Jan 10, 2025
3f70fdc
Merge remote-tracking branch 'origin/jl/caip-multichain-migrate-core'…
jiexi Jan 10, 2025
af1cb6a
Update app/scripts/metamask-controller.js
jiexi Jan 10, 2025
7e5782b
add wallet_registerOnboarding to Multichain API (#29491)
jiexi Jan 10, 2025
6d861f1
jsdoc createUnsupportedMethodMiddleware
jiexi Jan 10, 2025
49e9ac4
fix migration to skip malformed permission subjects (#29634)
adonesky1 Jan 10, 2025
79dc228
Update LavaMoat policies
metamaskbot Jan 10, 2025
dbed7a1
Multichain API e2e test: calling `wallet_invokeMethod` on the same da…
ffmcgee725 Jan 10, 2025
73ca76f
grant wallet:eip155 for dapps as well
jiexi Jan 10, 2025
5b027f8
annoying persistent local lint
jiexi Jan 10, 2025
c1cbb26
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Jan 10, 2025
c4b62c1
Multichain API E2E Test: wallet_notify (#29623)
ffmcgee725 Jan 10, 2025
70b9f05
Merge branch 'main' into caip25-permission-migration
jiexi Jan 10, 2025
3771ebc
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Jan 10, 2025
7688c40
Merge remote-tracking branch 'origin/jl/caip-multichain-migrate-core'…
jiexi Jan 10, 2025
9faf0e6
remove unnecessary JSON.stringify in wallet_createSession
jiexi Jan 10, 2025
08ff03d
add missing import
jiexi Jan 10, 2025
c7f9adc
remove eip3085 handling from wallet_createSession
jiexi Jan 10, 2025
f7f5c28
remove unused hooks
jiexi Jan 10, 2025
9d7a8a4
jsdoc wallet_createSession handler
jiexi Jan 10, 2025
f2e64be
remove processScopedProperties
jiexi Jan 10, 2025
9f58f3f
lint
jiexi Jan 10, 2025
61f1182
use preview build 298fc547
jiexi Jan 10, 2025
b27d53b
Update app/scripts/lib/rpc-method-middleware/handlers/wallet-requestP…
jiexi Jan 13, 2025
bea54cf
move getCaveat in requestPermittedChainsPermissionIncremental to afte…
jiexi Jan 13, 2025
2e078a8
Merge branch 'main' into caip25-permission-migration
jiexi Jan 13, 2025
50748b6
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Jan 13, 2025
6aea438
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Jan 13, 2025
ec4f301
move getCaveat in requestPermittedChainsPermissionIncremental to afte…
jiexi Jan 13, 2025
df60de4
Update ui/pages/permissions-connect/connect-page/connect-page.tsx
jiexi Jan 13, 2025
11faff5
Update ui/components/multichain/pages/review-permissions-page/site-ce…
jiexi Jan 13, 2025
abc0343
remove delays from sign.flow.ts
jiexi Jan 13, 2025
8d99f45
lint
jiexi Jan 13, 2025
422f379
Merge branch 'main' into caip25-permission-migration
jiexi Jan 13, 2025
e932140
lint
jiexi Jan 13, 2025
b1d52ad
Merge branch 'main' into caip25-permission-migration
jiexi Jan 13, 2025
cec2311
Merge branch 'main' into caip25-permission-migration
jiexi Jan 13, 2025
ebee234
Multichain API E2E Test: wallet_revokeSession (#29639)
ffmcgee725 Jan 14, 2025
0c0adf8
address partially mutation state bugs (#29682)
adonesky1 Jan 14, 2025
1817ba9
Multichain API E2E Test: wallet_createSession called with an existing…
ffmcgee725 Jan 14, 2025
6ebcb5f
Jl/restore legacy fixtures (#29674)
jiexi Jan 14, 2025
2846b0d
remove extraneous hooks
adonesky1 Jan 14, 2025
19826fe
dedupe
adonesky1 Jan 14, 2025
7240c13
lint
adonesky1 Jan 14, 2025
f166986
Merge branch 'main' into caip25-permission-migration
jiexi Jan 14, 2025
fe7469e
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Jan 14, 2025
10d4d9c
Update LavaMoat policies
metamaskbot Jan 14, 2025
492687c
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Jan 14, 2025
bb38fc4
Merge remote-tracking branch 'origin/jl/caip-multichain-migrate-core'…
jiexi Jan 14, 2025
0ba6f86
Merge remote-tracking branch 'origin/jl/caip-multichain-migrate-core'…
jiexi Jan 14, 2025
16c42b8
use preview build e05b7d3e
jiexi Jan 14, 2025
69a188b
Update LavaMoat policies
metamaskbot Jan 14, 2025
6633fb7
dedupe
adonesky1 Jan 14, 2025
113e643
update hookname: getCaveatForOrigin
adonesky1 Jan 14, 2025
106e7a6
Update LavaMoat policies
metamaskbot Jan 14, 2025
24fe195
wrap rpcErrors in flask build flags
adonesky1 Jan 14, 2025
65bd138
use preview build f3715655
jiexi Jan 14, 2025
baf0afc
fix getCaveatForOrigin
adonesky1 Jan 14, 2025
4b52240
Merge branch 'main' into caip25-permission-migration
jiexi Jan 14, 2025
20204ec
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Jan 14, 2025
9df1ef3
Merge remote-tracking branch 'origin/jl/caip-multichain-migrate-core'…
jiexi Jan 14, 2025
04d64da
use preview build 6244b7be
jiexi Jan 14, 2025
b89c40c
lint
jiexi Jan 14, 2025
8776db0
Multichain API E2E test: wallet_sessionChanged (#29706)
ffmcgee725 Jan 15, 2025
62621a1
Merge branch 'main' into caip25-permission-migration
adonesky1 Jan 15, 2025
113ba76
lint
adonesky1 Jan 15, 2025
29d2381
lint
adonesky1 Jan 15, 2025
236b2d4
Merge branch 'main' into caip25-permission-migration
jiexi Jan 15, 2025
9d73bd9
jsdoc captureKeyringTypesWithMissingIdentities
jiexi Jan 15, 2025
89ed1b3
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Jan 15, 2025
eb67f19
jsdoc sortAccountsByLastSelected
jiexi Jan 15, 2025
c86e052
Merge branch 'main' into caip25-permission-migration
jiexi Jan 15, 2025
ea4294a
Update app/scripts/migrations/138.ts
adonesky1 Jan 15, 2025
fdeb41e
Update app/scripts/migrations/138.ts
adonesky1 Jan 15, 2025
28094b5
Update app/scripts/migrations/138.ts
adonesky1 Jan 15, 2025
ab87b63
add comment/link for BUILT_IN_NETWORKS
adonesky1 Jan 15, 2025
9cdf8b7
address feedback / cleanup migration
adonesky1 Jan 15, 2025
43a0749
bail out of migration when encountering any data malformation
adonesky1 Jan 15, 2025
134f730
make malformation checks against networkConfigurations more strict
adonesky1 Jan 15, 2025
27b7353
Merge branch 'main' into caip25-permission-migration
jiexi Jan 15, 2025
8bdde06
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Jan 15, 2025
fe26dcf
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Jan 15, 2025
724e178
Merge remote-tracking branch 'origin/jl/caip-multichain-migrate-core'…
jiexi Jan 15, 2025
b2581f4
lint
jiexi Jan 15, 2025
6a6b1bf
Trigger
jiexi Jan 15, 2025
b213d94
add isNonEmptyArrayOfStrings to migration
jiexi Jan 15, 2025
2f0a4e5
Merge branch 'main' into caip25-permission-migration
jiexi Jan 15, 2025
0de03cc
Update test/e2e/tests/request-queuing/ui.spec.js
jiexi Jan 15, 2025
e13c029
test: multi dapp e2e test setup (wip)
ffmcgee725 Jan 15, 2025
9233f06
Revert ui/ducks/bridge/selectors.ts
jiexi Jan 15, 2025
dcdee7f
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Jan 15, 2025
a7ca50e
fix: fix failing test case
ffmcgee725 Jan 16, 2025
c71c37c
refactor: make sure to queue up all requests before making assertions…
ffmcgee725 Jan 16, 2025
f067dc7
refactor: make sure to use static constant variables for accounts in
ffmcgee725 Jan 16, 2025
5357693
Merge branch 'main' into caip25-permission-migration
jiexi Jan 16, 2025
651a40c
cleanup fixtures
jiexi Jan 16, 2025
b032101
clean fixtures deprecated-networks.spec.js and switch-custom-network.…
jiexi Jan 16, 2025
4c700fd
remove ERC_4337_ACCOUNT from withPreferencesControllerAdditionalAccou…
jiexi Jan 16, 2025
0f6c9f9
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
adonesky1 Jan 16, 2025
79678cd
update yarn.lock post rebase
adonesky1 Jan 16, 2025
6865dc5
Update LavaMoat policies
metamaskbot Jan 16, 2025
ad1ebd4
Merge branch 'jl/caip-multichain-migrate-core' into jc/multi-test-dap…
ffmcgee725 Jan 16, 2025
0412864
dedupe
adonesky1 Jan 16, 2025
792306f
fix wallet locked behavior
adonesky1 Jan 16, 2025
dea12c0
Update LavaMoat policies
metamaskbot Jan 16, 2025
ba9efbb
revert unecessary change to fixtures
jiexi Jan 16, 2025
7797d67
Merge branch 'main' into caip25-permission-migration
jiexi Jan 16, 2025
608ac95
revert unecessary change to fixtures 2
jiexi Jan 16, 2025
03624be
restore styling changes fixture
jiexi Jan 16, 2025
bd1e230
undo fixture changes that aren't needed
jiexi Jan 16, 2025
76f77b0
Merge branch 'main' into caip25-permission-migration
jiexi Jan 16, 2025
962c343
lint
jiexi Jan 16, 2025
3d0cfdd
lint
jiexi Jan 16, 2025
aba2d8a
Merge branch 'main' into caip25-permission-migration
jiexi Jan 17, 2025
1fb0f29
Update ui/components/multichain/edit-accounts-modal/edit-accounts-mod…
adonesky1 Jan 17, 2025
1bf080d
Multichain API E2E Test: handling when MetaMask is password locked (#…
ffmcgee725 Jan 17, 2025
688509c
refactor: revert changes to fixture-builder.js from commit f067dc76
ffmcgee725 Jan 17, 2025
5f96f94
Fix wallet_revokePermission spec
jiexi Jan 17, 2025
5e44957
fix: address fixture-builder.js change
ffmcgee725 Jan 17, 2025
d462d3c
minor change
ffmcgee725 Jan 17, 2025
4762e5c
Merge branch 'main' into caip25-permission-migration
jiexi Jan 17, 2025
18440d6
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Jan 17, 2025
4bff421
fix: fixture-builder.js
ffmcgee725 Jan 17, 2025
15fa319
Merge branch 'main' into caip25-permission-migration
jiexi Jan 17, 2025
c1b4b29
Merge branch 'caip25-permission-migration' into jl/caip-multichain-mi…
jiexi Jan 17, 2025
540899a
Merge remote-tracking branch 'origin/jl/caip-multichain-migrate-core'…
jiexi Jan 17, 2025
ad7169d
Update LavaMoat policies
metamaskbot Jan 17, 2025
13cf223
fix: properly setup permissions per dapp
ffmcgee725 Jan 17, 2025
ee1029b
merge jl/caip-multichain-migrate-core and fix conflicts
ffmcgee725 Jan 17, 2025
9638656
test: minor adjustments
ffmcgee725 Jan 30, 2025
ea96578
lint: remove unused variable
ffmcgee725 Jan 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -165,6 +165,10 @@ workflows:
requires:
- prep-build-test
- get-changed-files-with-git-diff
- test-api-specs-multichain:
requires:
- prep-build-test-flask
- get-changed-files-with-git-diff
- test-e2e-chrome-multiple-providers:
requires:
- prep-build-test
@@ -776,6 +780,37 @@ jobs:
- store_test_results:
path: test/test-results/e2e

test-api-specs-multichain:
executor: node-browsers-medium-plus
steps:
- run: *shallow-git-clone-and-enable-vnc
- run: sudo corepack enable
- attach_workspace:
at: .
- run:
name: Move test build to dist
command: mv ./dist-test-flask ./dist
- run:
name: Move test zips to builds
command: mv ./builds-test-flask ./builds
- gh/install
- run:
name: test:api-specs-multichain
command: .circleci/scripts/test-run-e2e.sh yarn test:api-specs-multichain
no_output_timeout: 5m
- run:
name: Comment on PR
command: |
if [ -f html-report-multichain/index.html ]; then
gh pr comment "${CIRCLE_PR_NUMBER}" --body ":x: Multichain API Spec Test Failed. View the report [here](https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/${CIRCLE_NODE_INDEX}/html-report-multichain/index.html)."
else
echo "Multichain API Spec Report not found!"
fi
when: on_fail
- store_artifacts:
path: html-report-multichain
destination: html-report-multichain

test-api-specs:
executor: node-browsers-medium-plus
steps:
1 change: 1 addition & 0 deletions .depcheckrc.yml
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@ ignores:
- '@metamask/forwarder'
- '@metamask/phishing-warning' # statically hosted as part of some e2e tests
- '@metamask/test-dapp'
- '@metamask/test-dapp-multichain'
- '@metamask/design-tokens' # Only imported in index.css
- '@tsconfig/node20' # required dynamically by TS, used in tsconfig.json
- '@sentry/cli' # invoked as `sentry-cli`
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -78,10 +78,13 @@ lavamoat/**/policy-debug.json
# Attributions
licenseInfos.json

# Branding
/app/images/branding

# API Spec tests
html-report/
html-report-multichain/

/app/images/branding
/changed-files

# UI Integration tests
24 changes: 17 additions & 7 deletions .storybook/test-data.js
Original file line number Diff line number Diff line change
@@ -1424,17 +1424,27 @@ const state = {
subjects: {
'https://app.uniswap.org': {
permissions: {
eth_accounts: {
invoker: 'https://app.uniswap.org',
parentCapability: 'eth_accounts',
id: 'a7342e4b-beae-4525-a36c-c0635fd03359',
date: 1620710693178,
'endowment:caip25': {
caveats: [
{
type: 'restrictReturnedAccounts',
value: ['0x64a845a5b02460acf8a3d84503b0d68d028b4bb4'],
type: 'authorizedScopes',
value: {
requiredScopes: {},
optionalScopes: {
'eip155:1': {
accounts: [
'eip155:1:0x64a845a5b02460acf8a3d84503b0d68d028b4bb4',
],
},
},
isMultichainOrigin: false,
},
},
],
invoker: 'https://app.uniswap.org',
id: 'a7342e4b-beae-4525-a36c-c0635fd03359',
date: 1620710693178,
parentCapability: 'endowment:caip25',
},
},
},
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/lib/index.js b/lib/index.js
index f5795884311124b221d91f488ed45750eb6e9c80..e030d6f8d8e85e6d1350c565d36ad48bc49af881 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -25,7 +25,7 @@ class Ptr {
});
return `/${tokens.join("/")}`;
}
- eval(instance) {
+ shmeval(instance) {
for (const token of this.tokens) {
if (instance.hasOwnProperty(token)) {
instance = instance[token];
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/build/resolve-pointer.js b/build/resolve-pointer.js
index d5a8ec7486250cd17572eb0e0449725643fc9842..044e74bb51a46e9bf3547f6d7a84763b93260613 100644
--- a/build/resolve-pointer.js
+++ b/build/resolve-pointer.js
@@ -27,7 +27,7 @@ exports.default = (function (ref, root) {
try {
var withoutHash = ref.replace("#", "");
var pointer = json_pointer_1.default.parse(withoutHash);
- return pointer.eval(root);
+ return pointer.shmeval(root);
}
catch (e) {
throw new InvalidJsonPointerRefError(ref, e.message);
4 changes: 4 additions & 0 deletions app/build-types/flask/manifest/_base.json
Original file line number Diff line number Diff line change
@@ -11,6 +11,10 @@
},
"default_title": "MetaMask Flask"
},
"externally_connectable": {
"matches": ["http://*/*", "https://*/*"],
"ids": ["*"]
},
"icons": {
"16": "images/icon-16.png",
"19": "images/icon-19.png",
6 changes: 0 additions & 6 deletions app/manifest/v2/_barad_dur.json

This file was deleted.

6 changes: 0 additions & 6 deletions app/manifest/v3/_barad_dur.json

This file was deleted.

21 changes: 13 additions & 8 deletions app/scripts/background.js
Original file line number Diff line number Diff line change
@@ -365,7 +365,9 @@ function overrideContentSecurityPolicyHeader() {
// These are set after initialization
let connectRemote;
let connectExternalExtension;
///: BEGIN:ONLY_INCLUDE_IF(build-flask)
let connectExternalCaip;
///: END:ONLY_INCLUDE_IF

browser.runtime.onConnect.addListener(async (...args) => {
// Queue up connection attempts here, waiting until after initialization
@@ -378,13 +380,18 @@ browser.runtime.onConnectExternal.addListener(async (...args) => {
// Queue up connection attempts here, waiting until after initialization
await isInitialized;
// This is set in `setupController`, which is called as part of initialization
const port = args[0];

if (port.sender.tab?.id && process.env.BARAD_DUR) {
///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-mmi)
connectExternalExtension(...args);
///: END:ONLY_INCLUDE_IF
///: BEGIN:ONLY_INCLUDE_IF(build-flask)
const port = args[0];
if (port.sender.tab?.id) {
connectExternalCaip(...args);
} else {
connectExternalExtension(...args);
}
///: END:ONLY_INCLUDE_IF
});

function saveTimestamp() {
@@ -677,13 +684,9 @@ function emitDappViewedMetricEvent(origin) {
return;
}

const permissions = controller.controllerMessenger.call(
'PermissionController:getPermissions',
origin,
);
const numberOfConnectedAccounts =
permissions?.eth_accounts?.caveats[0]?.value.length;
if (!numberOfConnectedAccounts) {
controller.getPermittedAccounts(origin).length;
if (numberOfConnectedAccounts === 0) {
return;
}

@@ -1021,6 +1024,7 @@ export function setupController(
});
};

///: BEGIN:ONLY_INCLUDE_IF(build-flask)
connectExternalCaip = async (remotePort) => {
if (metamaskBlockedPorts.includes(remotePort.name)) {
return;
@@ -1039,6 +1043,7 @@ export function setupController(
sender: remotePort.sender,
});
};
///: END:ONLY_INCLUDE_IF

if (overrides?.registerConnectListeners) {
overrides.registerConnectListeners(connectRemote, connectExternalExtension);
Loading
Loading