Closed ajimeno04 closed 2 months ago
This code is not correct, there are 2 main issues:
validateChainIdFromRPC()
function is used in an incorrect way: if it returns true
(i.e. the chainId
is valid) an error is thrown. validateChainIdFromRPC()
is an async
function, yet you are not await
ing the result. As a matter of fact, you cannot await
the result where the function is called, since the loadChainsConfig()
function is not an async
one. You're going to have to explore at which other point you can make the async
call, or how you can modify the current code to accommodate for it.
This pull request introduces a new method to validate the Chain ID obtained from a given RPC endpoint against an expected Chain ID. The aim is to ensure that the application is connected to the correct blockchain network.