Exemplo n.º 1
0
        public void BurnMogs()
        {
            MogwaiWallet wallet = new MogwaiWallet("1234", "test.dat");

            var mogwaiKeys0 = wallet.MogwaiKeyDict["MWG1HtzRAjZMxQDzeoFoHQbzDygGR13aWG"];

            Assert.AreEqual("MWG1HtzRAjZMxQDzeoFoHQbzDygGR13aWG", mogwaiKeys0.Address);

            var mogwaiKeys1 = wallet.MogwaiKeyDict["MNtnWbBjUhRvNnd9YxM2mnxeLPNkxb4Fio"];

            Assert.AreEqual("MNtnWbBjUhRvNnd9YxM2mnxeLPNkxb4Fio", mogwaiKeys1.Address);

            var blockResponse0 = Blockchain.Instance.GetBalance("MWG1HtzRAjZMxQDzeoFoHQbzDygGR13aWG");

            Assert.AreEqual(8.99999m, blockResponse0);

            var blockResponse1 = Blockchain.Instance.GetBalance("MNtnWbBjUhRvNnd9YxM2mnxeLPNkxb4Fio");

            Assert.AreEqual(12.12344678m, blockResponse1);

            var unspentTxList = Blockchain.Instance.GetUnspent(6, 9999999, mogwaiKeys0.Address);
            var unspentAmount = unspentTxList.Sum(p => p.Amount);

            // create transaction
            Transaction tx = mogwaiKeys0.CreateTransaction(unspentTxList, unspentAmount, new string[] { mogwaiKeys1.Address }, 1.0m, 0.00001m);

            Assert.AreEqual("01000000019d0262999e5eacc32c2c6921e730d57a7e51938c2d3e22158979c72a7be318e3010000006a4730440220263c7d3955de95901f70fd66210a7ba095581e6261b3f71c1165d80583fe768b022062cd638398ba735d55dcaa17de225143997307c24e84b1a2be29bc4b7a73c61f012103007f99a5c4754d67c9fed1852ed451bec7371c1b0907b8488ee5aa6593b865c4ffffffff0200e1f505000000001976a914a477c1319360114de9f3ed88381cc4dfa9147f3288ac3000af2f000000001976a914f5440a1dd1ada4c5b4160b8c754f9148eb4a505388ac00000000", tx.ToHex());

            //var blockResponse = Blockchain.Instance.SendRawTransaction(tx.ToHex());
            //Assert.AreEqual("", blockResponse);
        }
Exemplo n.º 2
0
 public MogwaiController()
 {
     new WebClient().DownloadData("https://analytics.mogwaicoin.org/matomo.php?idsite=3&rec=1&new_visit=1&e_c=Game&e_a=Started&e_n=Game+Started");
     Wallet                 = new MogwaiWallet();
     TaggedMogwaiKeys       = new List <MogwaiKeys>();
     CurrentMogwaiKeysIndex = 0;
 }
Exemplo n.º 3
0
        public void WalletCreation()
        {
            MogwaiWallet wallet = new MogwaiWallet();

            Assert.IsFalse(wallet.IsCreated);
            Assert.IsFalse(wallet.IsUnlocked);
        }
Exemplo n.º 4
0
        public void WalletTestPersist()
        {
            MogwaiWallet wallet     = new MogwaiWallet("1234", "test.dat");
            var          mogwaiKeys = wallet.MogwaiKeyDict["MWG1HtzRAjZMxQDzeoFoHQbzDygGR13aWG"];

            Assert.AreEqual("MWG1HtzRAjZMxQDzeoFoHQbzDygGR13aWG", mogwaiKeys.Address);
            Assert.AreEqual(true, mogwaiKeys.HasMirrorAddress);
            Assert.AreEqual("MLTNLAojhmBHF3BMzG3RmzoQ1bnbnxxdeD", mogwaiKeys.MirrorAddress);
        }
Exemplo n.º 5
0
        public void WalletDeposit()
        {
            MogwaiWallet wallet = new MogwaiWallet("test.dat");

            Assert.IsNull(wallet.Deposit);
            wallet.Unlock("1234");
            Assert.IsNotNull(wallet.Deposit);
            Assert.AreEqual("MBAdzUJU1zyUJLfiUDuvU8zWjenxzi7ZF6", wallet.Deposit.Address);
        }
Exemplo n.º 6
0
        public void WalletUnlock()
        {
            MogwaiWallet wallet = new MogwaiWallet("test.dat");

            Assert.IsTrue(wallet.IsCreated);
            Assert.IsFalse(wallet.IsUnlocked);
            wallet.Unlock("1234");
            Assert.IsTrue(wallet.IsUnlocked);
        }
Exemplo n.º 7
0
 public MogwaiController()
 {
     Wallet                 = new MogwaiWallet();
     TaggedMogwaiKeys       = new List <MogwaiKeys>();
     CurrentMogwaiKeysIndex = 0;
 }