public static void Init() { TestBtcAddr.Init(); log = new Log(); test = new Test(); settings = new Settings(); credentials = new Credentials(settings); db = new DB(); ticketClient = new TicketClient(settings); btc = new BTC( settings.data.btc_host, settings.data.btc_rpcuser, settings.data.btc_rpcpassword ); cert = new Cert(); btcAddrStorage = new BTCAddrStorage() { CNT = settings.data.storage_btc_addr_cnt }; btcAddrStorage.Init( settings .data .storage_btc_addr_types .Replace(" ", "") .Split(',') ); emailParser = new EmailParser() { mailer = new Mailer() }; emailParser.LoadLastEmails(App.settings.data.parse_last_emails); }
int GetCnt(string type) { return(App .btcAddrStorage .list .Find(el => el.name == BTCAddrStorage.ModType(type)) .list.Count); }
public static void TestInit() { TEST_MODE = true; log = new Log(); DB.RemoveDB(); settings = new Settings(); ticketClient = new TicketClient(settings); db = new DB(); /** * ticket - якобы созданный тикет от нетекса. * btc_income - якобы входящее бабло от btc клиента. * btc_address - якобы только что сгенерированный адрес от btc клиента. * fake_send_btc - будет всегда якобы отправлять бабло на этот btc адрес. */ test = new Test() { data = new TestData() { ticket = new Components.TicketClient.Responses.TicketClientCreateResponse() { account = "+79060671232", comment = "#3877525#", btc_amount = 0.8756 }, btc_income = 0.8756, btc_address = "3J6jjLs8DBpqPZvNoohDzzsRUqzgWyeMfG", fake_send_btc = "3J6jjLs8DBpqPZvNoohDzzsRUqzgWyeMfG" } }; btc = new BTC("", "", ""); btcAddrStorage = new BTCAddrStorage() { CNT = settings.data.storage_btc_addr_cnt }; btcAddrStorage.Init( settings .data .storage_btc_addr_types .Replace(" ", "") .Split(',') ); btcAddrStorage.UpdateAddressList(); }