From dd03428dd4fa0c566b8c9de2789fcb4013e7ec4e Mon Sep 17 00:00:00 2001 From: samepant Date: Sun, 30 Jan 2022 07:54:20 -0500 Subject: [PATCH] checks node connection on select --- components/chainSelect/ChainSelect.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components/chainSelect/ChainSelect.js b/components/chainSelect/ChainSelect.js index 8317cb4..b6b0cca 100644 --- a/components/chainSelect/ChainSelect.js +++ b/components/chainSelect/ChainSelect.js @@ -64,7 +64,6 @@ const ChainSelect = () => { return { label: name, value: index }; }); setChainOptions(options); - console.log(state.chain); setSelectValue(findExistingOption(options, state.chain.chainDisplayName)); } catch (error) { console.log(error); @@ -95,7 +94,6 @@ const ChainSelect = () => { const { data: chainData } = await axios.get(chainInfoUrl); const { data: assetData } = await axios.get(chainAssetUrl); - console.log(chainData, assetData); const nodeAddress = getNodeFromArray(chainData.apis.rpc); const addressPrefix = chainData["bech32_prefix"]; @@ -125,8 +123,9 @@ const ChainSelect = () => { } // test client connection - const client = await StargateClient.connect(state.chain.nodeAddress); - console.log("success?", client); + const client = await StargateClient.connect(nodeAddress); + await client.getHeight(); + // change app state dispatch({ type: "changeChain", @@ -176,8 +175,9 @@ const ChainSelect = () => { setChainError(null); try { // test client connection - const client = await StargateClient.connect(state.chain.nodeAddress); - console.log("success?", client); + const client = await StargateClient.connect(tempNodeAddress); + await client.getHeight(); + // change app state dispatch({ type: "changeChain",