private void Init() { RpcRoot.JsonRpc.GetAsync(RpcRoot.OfficialServerHost, RpcRoot.OfficialServerPort, ControllerUtil.GetControllerName <INTMinerWalletController>(), nameof(INTMinerWalletController.NTMinerWallets), null, (DataResponse <List <NTMinerWalletData> > response, Exception e) => { if (response.IsSuccess() && response.Data != null && response.Data.Count != 0) { var ethWallets = response.Data.Where(a => "ETH".Equals(a.CoinCode, StringComparison.OrdinalIgnoreCase)).ToArray(); if (ethWallets.Length != 0) { _ethWallets.Clear(); _ethWallets.AddRange(ethWallets.Select(a => a.Wallet)); } } }); }
public void GetControllerNameTest() { Assert.AreEqual("FileUrl", ControllerUtil.GetControllerName <IFileUrlController>()); }
protected override void UpdateWsStateAsync(string description, bool toOut) { if (VirtualRoot.DaemonOperation.IsNTMinerOpened()) { var state = base.GetState(); if (!string.IsNullOrEmpty(description)) { state.Description = description; } state.ToOut = toOut; RpcRoot.JsonRpc.FirePostAsync(NTKeyword.Localhost, NTKeyword.MinerClientPort, ControllerUtil.GetControllerName <IMinerClientController>(), nameof(IMinerClientController.ReportWsDaemonState), null, state, timeountMilliseconds: 3000); } }