Ejemplo n.º 1
0
        public void TestLoadAlgorithmFromZergPool()
        {
            ZergAPI   api   = new ZergAPI();
            Algorithm algor = api.LoadAlgorithm();

            Assert.AreEqual(true, algor.lyra2z != null);
        }
Ejemplo n.º 2
0
        public void TestLoadCurrencyFromZergPool()
        {
            ZergAPI        api        = new ZergAPI();
            CryptoCurrency currencies = api.LoadCurrency();

            Assert.AreEqual(true, currencies.Mano != null);
        }
Ejemplo n.º 3
0
        public void TestCompareHashRateFromZergPool()
        {
            ZergAPI        api        = new ZergAPI();
            CryptoCurrency currencies = api.LoadCurrency();

            CryptoCurrency.GIN  ginCoin  = currencies.Gin;
            CryptoCurrency.MANO manoCoin = currencies.Mano;
            Assert.AreNotEqual(manoCoin.hashrate, ginCoin.hashrate);
        }
Ejemplo n.º 4
0
        public void TestGetMiningGinCoinFromZergPerday()
        {
            long           myHashRate = 120000000L;
            ZergAPI        api        = new ZergAPI();
            CryptoCurrency currencies = api.LoadCurrency();

            CryptoCurrency.GIN ginCoin        = currencies.Gin;
            double             rewardPerBlock = double.Parse(ginCoin.reward);
            int  blockAllDay  = ginCoin.h24_blocks;
            long poolHashRate = ginCoin.hashrate ?? 0;

            if (ginCoin.hashrate_shared != null && ginCoin.hashrate_shared != 0)
            {
                poolHashRate = ginCoin.hashrate_shared ?? 0;
            }
            double receiveCoinPerDay = (rewardPerBlock / (double)poolHashRate) * myHashRate * blockAllDay;

            Assert.AreEqual(true, receiveCoinPerDay > 0);
        }
Ejemplo n.º 5
0
        public void TestGetMiningGinCoinFromZergPerday10Rounds()
        {
            long    myHashRate = 120000000L;
            ZergAPI api        = new ZergAPI();

            for (int i = 0; i < 10; i++)
            {
                CryptoCurrency     currencies     = api.LoadCurrency();
                CryptoCurrency.GIN ginCoin        = currencies.Gin;
                double             rewardPerBlock = double.Parse(ginCoin.reward);
                int  blockAllDay  = ginCoin.h24_blocks;
                long poolHashRate = ginCoin.hashrate ?? 0;
                if (ginCoin.hashrate_shared != null && ginCoin.hashrate_shared != 0)
                {
                    poolHashRate = ginCoin.hashrate_shared ?? 0;
                }
                double receiveCoinPerDay = (rewardPerBlock / (double)poolHashRate) * myHashRate * blockAllDay;
                System.Diagnostics.Debug.WriteLine(string.Format("round {0} GIN pool hashrate: {1} \t coin per day: {2}", i, poolHashRate, receiveCoinPerDay));
                System.Threading.Thread.Sleep(5000);
            }
            Assert.AreEqual(true, true);
        }