Skip to content
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
2 changes: 2 additions & 0 deletions tests/api-mocking/MockServerE2E.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
findMatchingPostEvent,
processPostRequestBody,
setupAccountsV2SupportedNetworksMock,
setupAccountsV4TransactionsMock,
} from './helpers/mockHelpers.ts';
import { getLocalHost } from '../framework/fixtures/FixtureUtils.ts';
import PortManager, { ResourceType } from '../framework/PortManager.ts';
Expand Down Expand Up @@ -298,6 +299,7 @@ export default class MockServerE2E implements Resource {
}

await setupAccountsV2SupportedNetworksMock(this._server);
await setupAccountsV4TransactionsMock(this._server);

await this._server
.forAnyRequest()
Expand Down
18 changes: 18 additions & 0 deletions tests/api-mocking/helpers/mockHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,24 @@ export async function setupAccountsV2SupportedNetworksMock(
});
}

/**
* Registers a default empty history response for Accounts API v4 transactions.
*/
export async function setupAccountsV4TransactionsMock(server: Mockttp) {
await setupMockRequest(server, {
requestMethod: 'GET',
url: /^https:\/\/accounts\.api\.cx\.metamask\.io\/v4\/multiaccount\/transactions(\?.*)?$/,
response: {
data: [],
pageInfo: {
count: 0,
hasNextPage: false,
},
},
responseCode: 200,
});
}

export interface SeenProxiedRequest {
method: string;
proxiedUrl: string;
Expand Down
Loading