Example #1
0
        public void FakeDeposite(int numOfTrans)
        {
            var repositoryConfig = new RepositoryConfiguration
            {
                ConnectionString = AppSettingHelper.GetDbConnection()
            };

            var persistenceFactory = new VakapayRepositoryMysqlPersistenceFactory(repositoryConfig);

            _ethBus = new Vakapay.EthereumBusiness.EthereumBusiness(persistenceFactory);
            var trans = new EthereumDepositTransaction()
            {
                UserId      = "8377a95b-79b4-4dfb-8e1e-b4833443c306",
                ToAddress   = "0x12890d2cce102216644c59dae5baed380d84830c",
                FromAddress = "0x3a2e25cfb83d633c184f6e4de1066552c5bf4517",
                Amount      = 10
            };
            ReturnObject outPut = null;

            for (int i = 0; i < numOfTrans; i++)
            {
                outPut = _ethBus.FakeDepositTransaction(trans);
            }
            Console.WriteLine(JsonHelper.SerializeObject(outPut));
            Assert.IsNotNull(outPut);
        }
        public async System.Threading.Tasks.Task CreateNewAddressAsync(string walletId)
        {
            var repositoryConfig = new RepositoryConfiguration
            {
                ConnectionString = AppSettingHelper.GetDbConnection()
            };

            var persistenceFactory = new VakapayRepositoryMysqlPersistenceFactory(repositoryConfig);

            _ethBus = new Vakapay.EthereumBusiness.EthereumBusiness(persistenceFactory);
            var connection = persistenceFactory.GetDbConnection();

            using (var ethAddressRepos = persistenceFactory.GetEthereumAddressRepository(connection))
            {
                _walletBusiness = new WalletBusiness.WalletBusiness(persistenceFactory);

                string pass = "******";
                //	var resultTest = _ethBus.CreateNewAddAddress(wallet);
                var outPut =
                    await _ethBus.CreateAddressAsync <EthereumAddress>(ethAddressRepos, RpcClass, walletId,
                                                                       pass);

                Assert.IsNotNull(outPut);
            }
        }
Example #3
0
        public async System.Threading.Tasks.Task CreateNewAddressAsync()
        {
            Console.WriteLine("WTF");
            var repositoryConfig = new RepositoryConfiguration
            {
                ConnectionString = AppSettingHelper.GetDbConnection()
            };

            Console.WriteLine("MAKE NEW");
            PersistenceFactory = new VakapayRepositoryMysqlPersistenceFactory(repositoryConfig);
            var connection = PersistenceFactory.GetDbConnection();

            _ethBus = new Vakapay.EthereumBusiness.EthereumBusiness(PersistenceFactory);
            using (var ethAddressRepos = PersistenceFactory.GetEthereumAddressRepository(connection))
            {
                string walletId = CommonHelper.RandomString(15);
                string pass     = CommonHelper.RandomString(15);
                var    outPut   =
                    await _ethBus.CreateAddressAsync <EthereumAddress>(ethAddressRepos, RpcClass, walletId, pass);

                Console.WriteLine(JsonHelper.SerializeObject(outPut));
                Assert.IsNotNull(outPut);
            }
        }