Skip to content

Commit

Permalink
Merge branch 'caip-multichain' into jl/caip-multichain/fix-connection…
Browse files Browse the repository at this point in the history
…-flow-for-permittedChains
  • Loading branch information
jiexi authored Oct 3, 2024
2 parents 1b4deb6 + 68db523 commit 7915c28
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,6 @@ export async function walletCreateSessionHandler(req, res, _next, end, hooks) {
isChainIdSupported: existsNetworkClientForChainId,
isChainIdSupportable: existsEip3085ForChainId,
});
// We assert if the unsupportable scopes are supported in order
// to have an appropriate error thrown for the response
assertScopesSupported(unsupportableRequiredScopes, {
isChainIdSupported: existsNetworkClientForChainId,
});

const {
supportedScopes: supportedOptionalScopes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,36 +285,6 @@ describe('wallet_createSession', () => {
expect(isChainIdSupportableBody).toContain('validScopedProperties');
});

it('asserts any unsupported required scopes', async () => {
const { handler } = createMockedHandler();
bucketScopes.mockReturnValueOnce({
unsupportableScopes: {
'foo:bar': {
methods: [],
notifications: [],
},
},
});
await handler(baseRequest);

expect(assertScopesSupported).toHaveBeenNthCalledWith(
1,
{
'foo:bar': {
methods: [],
notifications: [],
},
},
expect.objectContaining({
isChainIdSupported: expect.any(Function),
}),
);

const isChainIdSupportedBody =
assertScopesSupported.mock.calls[0][1].isChainIdSupported.toString();
expect(isChainIdSupportedBody).toContain('findNetworkClientIdByChainId');
});

it('buckets the optional scopes', async () => {
const { handler } = createMockedHandler();
validateAndFlattenScopes.mockReturnValue({
Expand Down

0 comments on commit 7915c28

Please sign in to comment.