From e56bd3b146023366d67a94bd3eb08d6a30c042fd Mon Sep 17 00:00:00 2001 From: tommasini Date: Tue, 2 Jul 2024 12:07:22 +0100 Subject: [PATCH] update the swap could not be completed as requested --- app/core/RPCMethods/RPCMethodMiddleware.test.ts | 2 +- app/core/RPCMethods/RPCMethodMiddleware.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/core/RPCMethods/RPCMethodMiddleware.test.ts b/app/core/RPCMethods/RPCMethodMiddleware.test.ts index b30844faf29..c9e66248e53 100644 --- a/app/core/RPCMethods/RPCMethodMiddleware.test.ts +++ b/app/core/RPCMethods/RPCMethodMiddleware.test.ts @@ -1357,7 +1357,7 @@ describe('getRpcMethodMiddleware', () => { const response = await callMiddleware({ middleware, request }); //@ts-expect-error now the response can have an error property await expect(response?.error?.message).toStrictEqual( - 'This address does not exist', + 'The swap could not be completed as requested', ); }); diff --git a/app/core/RPCMethods/RPCMethodMiddleware.ts b/app/core/RPCMethods/RPCMethodMiddleware.ts index 22e6ae1e45a..94ee918b3a0 100644 --- a/app/core/RPCMethods/RPCMethodMiddleware.ts +++ b/app/core/RPCMethods/RPCMethodMiddleware.ts @@ -428,7 +428,9 @@ export const getRpcMethodMiddleware = ({ ); if (!dappConnectedAccount) { - throw rpcErrors.invalidParams('This address does not exist'); + throw rpcErrors.invalidParams( + 'The swap could not be completed as requested', + ); } // This condition is only needed until we support multiple source tokens swap