Skip to content

Commit 43a055f

Browse files
committed
Added fix for non-valid chain type
1 parent ce607d9 commit 43a055f

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Hope.Ethereum/Hope.Ethereum.Unity/src/Utils/NetworkProvider.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ public static class NetworkProvider
1818
/// <param name="network"> The new active network chain. </param>
1919
public static void SwitchNetworkChain(Chain network)
2020
{
21+
if (network != Chain.MainNet && network != Chain.Rinkeby)
22+
network = Chain.Rinkeby;
23+
2124
ActiveNetwork = network;
2225
}
2326

Hope.Ethereum/Hope.Ethereum/src/Utils/NetworkProvider.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ public static class NetworkProvider
2020
/// <param name="network"> The new active network chain. </param>
2121
public static void SwitchNetworkChain(Chain network)
2222
{
23+
if (network != Chain.MainNet && network != Chain.Rinkeby)
24+
network = Chain.Rinkeby;
25+
2326
ActiveNetwork = network;
2427
Web3 = new Web3(GetNetworkChainUrl());
2528
}

0 commit comments

Comments
 (0)