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

fix: get wallet_getSession/revokeSession passing #27741

Merged
merged 4 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion test/e2e/api-specs/ConfirmationRejectionRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ export class ConfirmationsRejectRule implements Rule {
await this.driver.executeScript(
`window.ethereum.request(${switchEthereumChainRequest})`,
);

}
} catch (e) {
console.log(e);
Expand Down
1 change: 1 addition & 0 deletions test/e2e/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const convertETHToHexGwei = (eth) => convertToHexValue(eth * 10 ** 18);
* @property {Bundler} bundlerServer - The bundler server.
* @property {mockttp.Mockttp} mockServer - The mock server.
* @property {object} manifestFlags - Flags to add to the manifest in order to change things at runtime.
* @property {string} extensionId - the ID that the extension can be found at via externally_connectable.
*/

/**
Expand Down
38 changes: 28 additions & 10 deletions test/e2e/run-api-specs-multichain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import { MethodObject, OpenrpcDocument } from '@open-rpc/meta-schema';
import JsonSchemaFakerRule from '@open-rpc/test-coverage/build/rules/json-schema-faker-rule';
import ExamplesRule from '@open-rpc/test-coverage/build/rules/examples-rule';
import { Call, IOptions } from '@open-rpc/test-coverage/build/coverage';
import { IOptions } from '@open-rpc/test-coverage/build/coverage';
import { ScopeString } from '../../app/scripts/lib/multichain-api/scope';
import { Driver, PAGES } from './webdriver/driver';

Expand All @@ -25,7 +25,6 @@ import {
unlockWallet,
DAPP_URL,
ACCOUNT_1,
Fixtures,
} from './helpers';
import { MultichainAuthorizationConfirmation } from './api-specs/MultichainAuthorizationConfirmation';
import transformOpenRPCDocument from './api-specs/transform';
Expand All @@ -45,7 +44,13 @@ async function main() {
disableGanache: true,
title: 'api-specs coverage',
},
async ({ driver, extensionId }: any) => {
async ({
driver,
extensionId,
}: {
driver: Driver;
extensionId: string;
}) => {
await unlockWallet(driver);

// Navigate to extension home screen
Expand Down Expand Up @@ -173,20 +178,33 @@ async function main() {
);
server.start();

const getSession = doc.methods.find(
(m) => (m as MethodObject).name === 'wallet_getSession',
);
(getSession as MethodObject).examples = [
{
name: 'wallet_getSessionExample',
description: 'Example of a provider authorization request.',
params: [],
result: {
name: 'wallet_getSessionResultExample',
value: {
sessionScopes: {},
},
},
},
];

const testCoverageResults = await testCoverage({
openrpcDocument: doc,
transport,
reporters: ['console-streaming'],
skip: ['wallet_invokeMethod'],
rules: [
// new ExamplesRule({
// skip: [],
// only: [
// 'wallet_getSession',
// 'wallet_revokeSession'
// ],
// }),
new ExamplesRule({
skip: [],
only: ['wallet_getSession', 'wallet_revokeSession'],
}),
new MultichainAuthorizationConfirmation({
driver,
}),
Expand Down