fix: allows rejected eth_sendTransaction call to bubble to handler

Fixes: https://github.com/WalletConnect/walletconnect-monorepo/issues/854

There was a superfluous try/catch here which caused the rejection to be
logged and then continue instead of throwing and allowing the
JsonRpcHandler wrapper to handle the promise rejection.
This commit is contained in:
Ben Kremer 2022-03-14 11:11:16 +01:00
parent dad29d7611
commit 2b695af9f0

View File

@ -163,20 +163,14 @@ export function JsonRpcContextProvider({ children }: { children: ReactNode | Rea
}; };
} }
let result = ""; const result = await client!.request({
topic: session!.topic,
try { chainId,
result = await client!.request({ request: {
topic: session!.topic, method: "eth_sendTransaction",
chainId, params: [tx],
request: { },
method: "eth_sendTransaction", });
params: [tx],
},
});
} catch (error) {
console.error(error);
}
// format displayed result // format displayed result
return { return {