Ejemplo n.º 1
0
        public IActionResult AddCoinIn(string publicKey)
        {
            Wallet wallet = _transactionservice.FindWallet(publicKey);

            HomeAddCoinInViewModel vm = new HomeAddCoinInViewModel
            {
                OwnerPublicKey = wallet.PublicKey,
                WalletId       = wallet.WalletId
            };

            return(View(vm));
        }
Ejemplo n.º 2
0
        public IActionResult AddCoinIn(HomeAddCoinInViewModel vm)
        {
            CoinInput coinInput = new CoinInput
            {
                PublicKey = vm.OwnerPublicKey,
                Signature = "placeholder signature",
                Amount    = vm.Amount,
                WalletId  = vm.WalletId
            };

            _transactionservice.AddCoinIn(coinInput);

            Block block = new Block
            {
                Data = HashHelper.CalculateHash(coinInput.ToString()),
            };

            _blockservice.AddNextBlock(block);

            return(RedirectToAction("Index", "Home"));
        }