public void TestMethod_TradeOrder_SEQUENCE_Success()
        {
            Wallet merchant_wallet = WalletGenericTest.GetWallet(MERCHANT_PRIVATE_KEY);
            Wallet customer_wallet = WalletGenericTest.GetWallet(CUSTOMER_PRIVATE_KEY);

            var result = merchant_wallet.TradeOrder(TradeOrderTypes.Sell, DISCOUNT_TOKEN, REWARD_TOKEN, 100.00M, 1.00M, 10, true, false).Result;

            Assert.AreEqual(APIResultCodes.Success, result.ResultCode);

            var auth_result = merchant_wallet.Send(10M, customer_wallet.AccountId, REWARD_TOKEN).Result;

            Assert.AreEqual(APIResultCodes.Success, auth_result.ResultCode);

            var sync_result = customer_wallet.Sync(null).Result;

            Assert.AreEqual(APIResultCodes.Success, sync_result);

            var orders_result = customer_wallet.GetActiveTradeOrders(null, null, Core.Blocks.TradeOrderListTypes.All).Result;

            Assert.AreEqual(APIResultCodes.Success, orders_result.ResultCode);

            if (orders_result.Successful())
            {
                var order_list  = orders_result.GetList();
                var order_block = order_list[0];

                result = customer_wallet.TradeOrder(TradeOrderTypes.Buy, REWARD_TOKEN, DISCOUNT_TOKEN, 1.00M, 1.00M, 10, false, true).Result;
                Assert.AreEqual(APIResultCodes.TradeOrderMatchFound, result.ResultCode);

                var trade_block = result.GetBlock();

                auth_result = customer_wallet.Trade(trade_block).Result;
                Assert.AreEqual(APIResultCodes.Success, auth_result.ResultCode);

                auth_result = merchant_wallet.ExecuteSellOrder(trade_block, order_block, null).Result;
                Assert.AreEqual(APIResultCodes.Success, auth_result.ResultCode);
            }


            //result = customer_wallet.Trade(null, null, Core.Blocks.TradeOrderListTypes.All).Result;
            //Assert.AreEqual(APIResultCodes.Success, result.ResultCode);
        }
        public void TestMethod_FULL_TRADE_TEST()
        {
            Wallet merchant_wallet = WalletGenericTest.GetWallet(MERCHANT_PRIVATE_KEY);

            Wallet customer_wallet = WalletGenericTest.GetWallet(CUSTOMER_PRIVATE_KEY);

            var result = merchant_wallet.CreateGenesisForCoreToken();

            Assert.AreEqual(APIResultCodes.Success, result);

            result = merchant_wallet.CreateToken("rewards", "rewards", "", 2, 1000000, false, "Slava", "", "", Core.Blocks.Transactions.ContractTypes.RewardPoint, null).Result.ResultCode;
            Assert.AreEqual(APIResultCodes.Success, result);

            result = merchant_wallet.CreateToken("discounts", "discounts", "", 2, 1000000, false, "Slava", "", "", Core.Blocks.Transactions.ContractTypes.RedeemedDiscount, null).Result.ResultCode;
            Assert.AreEqual(APIResultCodes.Success, result);

            result = merchant_wallet.TradeOrder(TradeOrderTypes.Sell, "discounts.discounts", "rewards.rewards", 100.00M, 1.00M, 10, true, false).Result.ResultCode;

            result = customer_wallet.GetActiveTradeOrders(null, null, Core.Blocks.TradeOrderListTypes.All).Result.ResultCode;

            Assert.AreEqual(APIResultCodes.Success, result);
        }