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

feat: Migrate eth_accounts and permittedChains to CAIP-25 endowment #27847

Open
wants to merge 289 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
289 commits
Select commit Hold shift + click to select a range
6cd118d
add request-accounts.test.ts. convert requestAccounts js to ts
jiexi Oct 15, 2024
6552101
convert eth-accounts to ts
jiexi Oct 15, 2024
21293c3
Make requestPermissions test mock more accurate
jiexi Oct 15, 2024
8c4a4d1
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 15, 2024
669fa71
convert ethereum-chain-utils.test.js to ts
jiexi Oct 16, 2024
dba9ae5
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 16, 2024
c39fc0d
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 16, 2024
bbffb07
fix duplicated imports
jiexi Oct 16, 2024
2b80d23
revert isAccountSyncingEnabled
jiexi Oct 16, 2024
db866f0
DRY requestAccountsPermissionWithId into requestAccountsAndChainPermi…
jiexi Oct 16, 2024
8c8d5ed
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 16, 2024
b40c72e
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 16, 2024
aa5067f
Remove TODO about verifying switchChain permissioning flow
jiexi Oct 16, 2024
902bd5a
Remove selectors intended for multichain API
jiexi Oct 16, 2024
aa36957
lint request-accounts.test.ts
jiexi Oct 16, 2024
4363f12
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 16, 2024
865f09c
fix switch chain permission confirmation
adonesky1 Oct 16, 2024
a2c1c61
update preview builds
adonesky1 Oct 16, 2024
86a6a41
fix yarn.lock
adonesky1 Oct 16, 2024
7c14f68
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 16, 2024
e7a351c
Add revoke permitted-chains e2e test
jiexi Oct 16, 2024
c96672d
Jl/caip25 permission migration/bump permissions controller fix UI spe…
jiexi Oct 16, 2024
c63d8d2
Update LavaMoat policies
metamaskbot Oct 16, 2024
5147e8b
Update app/scripts/lib/rpc-method-middleware/handlers/wallet-revokePe…
jiexi Oct 16, 2024
b768c8c
fix background dapp viewed event
jiexi Oct 16, 2024
8c4faed
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Oct 16, 2024
6828cd2
Update fixture-builder to set correct default scopes
jiexi Oct 16, 2024
d83629b
fix background-api spec
jiexi Oct 16, 2024
46d7c0d
fix ethereum-chain-utils.test.ts
jiexi Oct 16, 2024
8d59135
fix ethereum-chain-utils.test.ts 2
jiexi Oct 16, 2024
a019845
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 16, 2024
08b9f2b
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 17, 2024
1923910
reset lavamoat back to develop
jiexi Oct 17, 2024
8ba031c
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 17, 2024
bf856b8
Update LavaMoat policies
metamaskbot Oct 17, 2024
7212a37
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 17, 2024
fe584ed
fix fixture-builder restrictReturnedAccounts???
jiexi Oct 17, 2024
2497a19
Remove restrictedReturnedAccounts in fixtures. Fix snap-account-signa…
jiexi Oct 17, 2024
3e583a4
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 17, 2024
b780d89
temporarily skip test-snap-revoke-perm.spec.js
jiexi Oct 17, 2024
06e7ef9
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 17, 2024
609d50f
dedupe
adonesky1 Oct 17, 2024
8015644
Update LavaMoat policies
metamaskbot Oct 17, 2024
4ae7377
bring in preview build from new core pr
jiexi Oct 17, 2024
9d3d250
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Oct 17, 2024
16d8be4
lavamoat
jiexi Oct 17, 2024
2735fa5
Update LavaMoat policies
metamaskbot Oct 17, 2024
ac774da
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 17, 2024
91255c4
bring in new preview build for listAccounts() in permission validator
jiexi Oct 17, 2024
7502f0a
Merge remote-tracking branch 'origin' into caip25-permission-migration
adonesky1 Oct 18, 2024
773a744
Update LavaMoat policies
metamaskbot Oct 18, 2024
ea84c0e
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 18, 2024
5262186
fix switch-custom-network test failure
adonesky1 Oct 18, 2024
832e61e
update json-rpc-engine type import
adonesky1 Oct 18, 2024
20ff891
fix other json-rpc-engine imports
adonesky1 Oct 18, 2024
f5df08d
add fixtures to fix test
adonesky1 Oct 18, 2024
e2d8305
fix: add snap dummy descriptions copied from ethereum provider and ge…
shanejonas Oct 18, 2024
af25cf0
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 18, 2024
2d53a55
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 21, 2024
ac192fc
lavamoat
jiexi Oct 21, 2024
47e6494
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 21, 2024
d151b63
Update LavaMoat policies
metamaskbot Oct 21, 2024
599a73d
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 21, 2024
9b023f0
Caip25/fix snaps signature disconnect (#27998)
jiexi Oct 21, 2024
b1156e6
lint
jiexi Oct 21, 2024
879b30e
Fix flask/user-operations.spec.ts
jiexi Oct 21, 2024
25bfb4f
Remove html-report-multichain/
jiexi Oct 21, 2024
4eaad52
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 22, 2024
540b4c5
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 22, 2024
155293d
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 22, 2024
77c7a66
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 22, 2024
ec037c5
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 22, 2024
e10b65f
Jl/caip25 permission migration/metamask controller test (#28012)
jiexi Oct 22, 2024
9d9c3f4
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 22, 2024
7f70c0b
yarn lock
jiexi Oct 22, 2024
a757cbf
bring in new preview build with 100% coverage
jiexi Oct 23, 2024
5dfa1e8
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 23, 2024
a1d4e40
Update LavaMoat policies
metamaskbot Oct 23, 2024
87109ea
Merge branch 'develop' into caip25-permission-migration
jiexi Oct 30, 2024
6b3dda9
Update LavaMoat policies
metamaskbot Oct 30, 2024
7f1ea33
use addPermittedChain instead of grant. delete grantPermittedChain(s)
jiexi Oct 30, 2024
52f5f59
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Oct 30, 2024
e8cb9b3
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 20, 2024
48381e0
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 20, 2024
b7198c1
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 20, 2024
c84d9e6
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 20, 2024
f75a49f
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 21, 2024
993e6fc
CAIP-25 Permission Migration Refactor (#28574)
jiexi Nov 21, 2024
d3ed412
Merge branch 'develop' into caip25-permission-migration
adonesky1 Nov 21, 2024
87ce7e4
use `@metamask/multichain@^1.0.0`!!!
jiexi Nov 21, 2024
6b6c668
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Nov 21, 2024
ce5f57b
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 21, 2024
fcffac4
Update LavaMoat policies
metamaskbot Nov 21, 2024
7435114
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 21, 2024
13d0390
yarn dedupe
jiexi Nov 21, 2024
5a5242b
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 21, 2024
ea8a594
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 22, 2024
5b8a8a2
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 22, 2024
9651ad4
Update LavaMoat policies
metamaskbot Nov 22, 2024
151e381
Merge branch 'develop' into caip25-permission-migration
adonesky1 Nov 25, 2024
618d70d
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 25, 2024
b4346f4
Fix edit accounts and networks modal default rerendering
jiexi Nov 25, 2024
d55c5ea
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 25, 2024
e607539
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 26, 2024
0fead5c
move sessionChanged notif constant to Multichain PR
jiexi Nov 26, 2024
d6a3a40
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 26, 2024
5a770c4
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 26, 2024
bf99973
dispatch addPermittedChain in network-list-menu
jiexi Nov 26, 2024
d96d85d
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 26, 2024
d2fd282
Jl/caip25 permission migration/update mutators (#28709)
jiexi Nov 26, 2024
042b2f5
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 26, 2024
9e156ef
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 26, 2024
6fa667b
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 27, 2024
514ceb5
Merge branch 'develop' into caip25-permission-migration
jiexi Nov 27, 2024
9bddebd
Merge branch 'main' into caip25-permission-migration
jiexi Dec 2, 2024
5e77989
Merge branch 'main' into caip25-permission-migration
jiexi Dec 3, 2024
b08f4e6
revert removeNetwork half fix
jiexi Dec 4, 2024
337a6a0
replace snaps eth_accounts references (#28937)
jiexi Dec 4, 2024
e8c2a1a
Jl/caip25 permission migration/fix locked wallet behavior (#28855)
jiexi Dec 4, 2024
7f529d1
Merge branch 'main' into caip25-permission-migration
jiexi Dec 4, 2024
b26fa78
Merge branch 'main' into caip25-permission-migration
jiexi Dec 5, 2024
7869d3b
yarn dedupe
jiexi Dec 5, 2024
827de7c
Merge branch 'main' into caip25-permission-migration
jiexi Dec 5, 2024
ad34375
Merge branch 'main' into caip25-permission-migration
jiexi Dec 6, 2024
5e67909
Update app/scripts/lib/rpc-method-middleware/handlers/switch-ethereum…
jiexi Dec 6, 2024
1e759cf
Update app/scripts/lib/rpc-method-middleware/handlers/wallet-revokePe…
jiexi Dec 6, 2024
d089099
Update app/scripts/lib/rpc-method-middleware/handlers/wallet-getPermi…
jiexi Dec 6, 2024
7f6c67f
Add '| undefined' to caveat.find() return type coercions
jiexi Dec 6, 2024
5e92074
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Dec 6, 2024
b7205e4
Update app/scripts/lib/rpc-method-middleware/handlers/ethereum-chain-…
jiexi Dec 6, 2024
4b37d18
Update app/scripts/lib/rpc-method-middleware/handlers/switch-ethereum…
jiexi Dec 6, 2024
bc07690
Update app/scripts/lib/rpc-method-middleware/handlers/wallet-requestP…
jiexi Dec 6, 2024
58e100e
address request-accounts.test.ts comments
jiexi Dec 6, 2024
96c5ed4
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Dec 6, 2024
3e34097
fully mock ethereum-chain-utils in add/switchEthreumChain handlers
jiexi Dec 7, 2024
baeeb1e
Copy validateAdd/SwitchEthereumChainParams specs to ethereum-chain-ut…
jiexi Dec 9, 2024
0f08ab4
Lint
jiexi Dec 9, 2024
62e4a35
Merge branch 'main' into caip25-permission-migration
jiexi Dec 9, 2024
f7a09fd
Make wallet_requestPermissions test origin explicit
jiexi Dec 9, 2024
ed503e4
make getBaseRequest take overrides in wallet-requestPermissions.test.ts
jiexi Dec 9, 2024
ac48b67
catch PermissionDoesNotExistError in getCaveat calls
jiexi Dec 9, 2024
fb118fe
update addMoreChains getEthAccounts comment
jiexi Dec 9, 2024
3442d7d
make otherPermission explicit in wallet-revokePermissions.test.ts
jiexi Dec 9, 2024
6903494
Merge branch 'main' into caip25-permission-migration
jiexi Dec 9, 2024
c69eda3
Update app/scripts/lib/rpc-method-middleware/handlers/wallet-requestP…
jiexi Dec 9, 2024
892af78
nest scenario in describe add-ethereum-chain.test.js
jiexi Dec 9, 2024
2ec971d
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Dec 9, 2024
4cb71a0
Merge branch 'main' into caip25-permission-migration
jiexi Dec 9, 2024
200a778
cleanup add-ethereum-chain.test.ts
jiexi Dec 9, 2024
16987cd
add jsdoc to switchChain
jiexi Dec 9, 2024
fca9657
cleanup getAccounts in wallet-getPermissions.test.ts
jiexi Dec 9, 2024
63b99eb
Fix switchChain approvalFlowId type
jiexi Dec 9, 2024
bf33584
fix 'requests a switch chain approval' scenario
jiexi Dec 9, 2024
91df27d
make wallet-getPermissions.test.ts clearer
jiexi Dec 9, 2024
0161067
lint
jiexi Dec 9, 2024
d160ce1
Update LavaMoat policies
metamaskbot Dec 9, 2024
797273c
lint
jiexi Dec 9, 2024
d4c8df2
move requestAccountsAndChainPermissionsWithId logic into separate asy…
jiexi Dec 9, 2024
b532861
remove addMoreChains comment
jiexi Dec 10, 2024
ee043eb
add comment about addAndShowApprovalRequest usage in background-api
jiexi Dec 10, 2024
bccd7d5
Merge branch 'main' into caip25-permission-migration
jiexi Dec 10, 2024
0ffeec2
bump @metamask/multichain to ^1.1.2
jiexi Dec 10, 2024
06c9a70
Merge branch 'main' into caip25-permission-migration
jiexi Dec 11, 2024
88dd6be
Update app/scripts/lib/rpc-method-middleware/createMethodMiddleware.js
jiexi Dec 11, 2024
8d8036f
remove getRemovedAuthorizations
jiexi Dec 11, 2024
57f3fe9
Merge branch 'main' into caip25-permission-migration
jiexi Dec 11, 2024
17454e6
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Dec 11, 2024
61e886c
mvoe endowment:caip25 into ExcludedSnapEndowments
jiexi Dec 11, 2024
6817121
Merge branch 'main' into caip25-permission-migration
jiexi Dec 11, 2024
c9b023b
update getPermissionSpecifications jsdoc
jiexi Dec 11, 2024
a6f424b
Merge branch 'main' into caip25-permission-migration
jiexi Dec 11, 2024
8a4bd74
Merge branch 'main' into caip25-permission-migration
jiexi Dec 12, 2024
8d276ce
Merge branch 'main' into caip25-permission-migration
jiexi Dec 12, 2024
6477802
refactor: Robustify migration 135 (#29168)
rekmarks Dec 12, 2024
2a755cb
Merge branch 'main' into caip25-permission-migration
jiexi Dec 12, 2024
d7ce25e
Merge remote-tracking branch 'origin/caip25-permission-migration' int…
jiexi Dec 12, 2024
cd66487
lint
jiexi Dec 12, 2024
7af8dbb
Jl/caip25 permission migration/bind origin to method hooks (#29174)
jiexi Dec 12, 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
a86e802
Merge branch 'main' into caip25-permission-migration
jiexi Dec 16, 2024
ad3eb1b
Merge branch 'main' into caip25-permission-migration
jiexi Dec 16, 2024
18af503
Merge branch 'main' into caip25-permission-migration
jiexi Dec 16, 2024
d000725
feat: Move CAIP-25 permission validation logic into caveat validator …
jiexi Dec 16, 2024
ff3b272
Jl/caip25 permission migration/move request grant hooks into mmc (#29…
jiexi 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
cf7c328
Merge branch 'main' into caip25-permission-migration
jiexi Dec 17, 2024
0c97ce9
fix testDapp.connectAccount usage
jiexi Dec 17, 2024
5d22667
Merge branch 'main' into caip25-permission-migration
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
cb4126d
Merge branch 'main' into caip25-permission-migration
jiexi Dec 19, 2024
85d0e94
Merge branch 'main' into caip25-permission-migration
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
9657527
Merge branch 'main' into caip25-permission-migration
jiexi Dec 20, 2024
0ab7368
Merge branch 'main' into caip25-permission-migration
jiexi Dec 20, 2024
e749a8a
Merge branch 'main' into caip25-permission-migration
jiexi Dec 20, 2024
d8fab7f
Merge branch 'main' into caip25-permission-migration
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
e66e970
Merge branch 'main' into caip25-permission-migration
jiexi Jan 6, 2025
aec0472
Merge branch 'main' into caip25-permission-migration
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
1ef2033
replace parseInt with hexToBigInt
jiexi Jan 8, 2025
b9e61e0
Merge branch 'main' into caip25-permission-migration
jiexi Jan 8, 2025
52e6ea2
Merge branch 'main' into caip25-permission-migration
jiexi Jan 8, 2025
132e784
Merge branch 'main' into caip25-permission-migration
jiexi Jan 8, 2025
097ef14
Fix wallet_requestPermissions approval ordering
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
49e9ac4
fix migration to skip malformed permission subjects (#29634)
adonesky1 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
70b9f05
Merge branch 'main' into caip25-permission-migration
jiexi Jan 10, 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
26 changes: 19 additions & 7 deletions .storybook/test-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -1398,17 +1398,29 @@ 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': {
methods: [],
notifications: [],
accounts: [
'eip155:1:0x64a845a5b02460acf8a3d84503b0d68d028b4bb4',
],
},
},
isMultichainOrigin: false,
},
},
],
invoker: 'https://app.uniswap.org',
id: 'a7342e4b-beae-4525-a36c-c0635fd03359',
date: 1620710693178,
parentCapability: 'endowment:caip25',
},
},
},
Expand Down
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) {
jiexi marked this conversation as resolved.
Show resolved Hide resolved
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);
jiexi marked this conversation as resolved.
Show resolved Hide resolved
}
catch (e) {
throw new InvalidJsonPointerRefError(ref, e.message);
9 changes: 2 additions & 7 deletions app/scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -641,13 +641,8 @@ function emitDappViewedMetricEvent(origin) {
return;
}

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

Expand Down
Loading
Loading