Ejemplo n.º 1
0
        public async System.Threading.Tasks.Task CreateNewAddressAsync()
        {
            Console.WriteLine("start");
            var repositoryConfig = new RepositoryConfiguration
            {
                ConnectionString = AppSettingHelper.GetDbConnection()
            };

            Console.WriteLine("New Address");
            PersistenceFactory = new VakapayRepositoryMysqlPersistenceFactory(repositoryConfig);
            var connection = PersistenceFactory.GetDbConnection();

            _btcBus = new Vakapay.BitcoinBusiness.BitcoinBusiness(PersistenceFactory);
            var    bitcoinRepo   = PersistenceFactory.GetBitcoinAddressRepository(connection);
            string walletId      = CommonHelper.RandomString(15);
            var    resultCreated =
                await _btcBus.CreateAddressAsync <BitcoinAddress>(bitcoinRepo, RpcClass, walletId);

            Console.WriteLine(JsonHelper.SerializeObject(resultCreated));
            Assert.IsNotNull(resultCreated);
        }
Ejemplo n.º 2
0
        public void FakePeningTransaction(int numOfTrans)
        {
            var repositoryConfig = new RepositoryConfiguration
            {
                ConnectionString = AppSettingHelper.GetDbConnection()
            };

            var persistenceFactory = new VakapayRepositoryMysqlPersistenceFactory(repositoryConfig);

            _btcBus = new Vakapay.BitcoinBusiness.BitcoinBusiness(persistenceFactory);
            var trans = new BitcoinWithdrawTransaction
            {
                ToAddress = "2Muk22rW4opjTd18KA48bzHUqiG19ZUJDLb",
                Amount    = (decimal)0.0001
            };
            ReturnObject outPut = null;

            for (int i = 0; i < numOfTrans; i++)
            {
                outPut = _btcBus.FakePendingTransaction(trans);
            }
            Console.WriteLine(JsonHelper.SerializeObject(outPut));
            Assert.IsNotNull(outPut);
        }