Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
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);
            }
        }