Rimmon 3 роки тому
батько
коміт
929597eda0
2 змінених файлів з 11 додано та 4 видалено
  1. 7 0
      Models/Blockchain.cs
  2. 4 4
      Pages/Blockchains.razor

+ 7 - 0
Models/Blockchain.cs

@@ -10,6 +10,7 @@ namespace HyperCube.Models
 {
     public class Blockchain
     {
+        public static Dictionary<int, Blockchain> supported;
         public static string Connected
         {
             get {
@@ -19,6 +20,7 @@ namespace HyperCube.Models
                 return "none";
             }            
         }
+        public static int selectedNum;
         public static string URLdefault = "127.0.0.1";
         public static int defaultPort = 8545;
         public static string defaultName = "Ethereum dev network";
@@ -33,6 +35,11 @@ namespace HyperCube.Models
         public string name;
         static Blockchain instance;
 
+        public static void RegisterNetworks()
+        {
+            //Initialize(name, url, port)
+        }
+
         public static Blockchain GetInstance()
         {
             if (instance == null)

+ 4 - 4
Pages/Blockchains.razor

@@ -56,10 +56,10 @@
         </p>
     }
 }
-
-<select style="color:green">
-    <option>Ethereum Dev Network</option>
-    <option>Ethereum Test Network</option>
+<p>@Blockchain.selectedNum</p>
+<select @bind="Blockchain.selectedNum" style="color:green">
+    <option value=0>Ethereum Dev Network</option>
+    <option value=1>Ethereum Test Network</option>
 </select>
 <p></p>
 <p style="visibility:@hidecontr">