Пример #1
0
        public async Task <ActionResult> DestinationAddressRouteFound(string senderAddress, string contractAddress)
        {
            var model = new DestinationAddressRouteFoundViewModel()
            {
                CallerAddress   = senderAddress,
                ContractAddress = contractAddress,
                //ContractState = MapToContractStateEnum(result)
            };

            return(View(model));
        }
Пример #2
0
        public async Task <ActionResult> PostDestinationAddressRouteFound(DestinationAddressRouteFoundViewModel model)
        {
            var ipcClient = new Nethereum.JsonRpc.IpcClient.IpcClient(_getAddress);
            var web3      = new Web3(ipcClient);
            var contract  = web3.Eth.GetContract(_abi, model.ContractAddress);
            var destinationAddressRouteFoundFunction = contract.GetFunction("destinationAddressRouteFound");

            // Unlock the caller's account with the given password
            var unlockResult = await web3.Personal.UnlockAccount.SendRequestAsync(model.CallerAddress, model.CallerPassword, _accountUnlockTime);

            var transactionHash = await destinationAddressRouteFoundFunction.SendTransactionAsync(model.CallerAddress);

            model.TransactionHash = transactionHash;
            model.Message         = "RouteFound Transaction Sent.";
            return(View("DestinationAddressRouteFound", model));
        }