mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-01 13:47:06 +01:00
7ba0f78a84
* snaps-skunkworks@0.22.0 * Update LavaMoat policies * Bump execution environment and fix a breaking change * Fix caveat and permissions * Fix test * Exclude keyring endowment for now * Fix test * Fix snap_confirm missing title
32 lines
954 B
JavaScript
32 lines
954 B
JavaScript
import { endowmentPermissionBuilders } from '@metamask/snap-controllers';
|
|
import { restrictedMethodPermissionBuilders } from '@metamask/rpc-methods';
|
|
import {
|
|
EndowmentPermissions,
|
|
ExcludedSnapEndowments,
|
|
ExcludedSnapPermissions,
|
|
RestrictedMethods,
|
|
} from './permissions';
|
|
|
|
describe('EndowmentPermissions', () => {
|
|
it('has the expected permission keys', () => {
|
|
expect(Object.keys(EndowmentPermissions).sort()).toStrictEqual(
|
|
Object.keys(endowmentPermissionBuilders)
|
|
.filter((targetKey) => !ExcludedSnapEndowments.has(targetKey))
|
|
.sort(),
|
|
);
|
|
});
|
|
});
|
|
|
|
describe('RestrictedMethods', () => {
|
|
it('has the expected permission keys', () => {
|
|
expect(Object.keys(RestrictedMethods).sort()).toStrictEqual(
|
|
[
|
|
'eth_accounts',
|
|
...Object.keys(restrictedMethodPermissionBuilders).filter(
|
|
(targetKey) => !ExcludedSnapPermissions.has(targetKey),
|
|
),
|
|
].sort(),
|
|
);
|
|
});
|
|
});
|