public async void TestCQS()
        {
            var senderAddress = AccountFactory.Address;
            var web3          = _ethereumClientIntegrationFixture.GetWeb3();

            var deploymentMessage = new TestContractDeployment()
            {
                FromAddress = senderAddress
            };
            var deploymentHandler  = web3.Eth.GetContractDeploymentHandler <TestContractDeployment>();
            var transactionReceipt = await deploymentHandler.SendRequestAndWaitForReceiptAsync(deploymentMessage);

            var contractHandler = web3.Eth.GetContractHandler(transactionReceipt.ContractAddress);
            var result          = await contractHandler.QueryAsync <ReturnArrayFunction, List <string> >();

            Assert.Equal(10, result.Count);
        }
Exemplo n.º 2
0
        public async void TestCQS()
        {
            var senderAddress = EthereumClientIntegrationFixture.AccountAddress;
            var web3          = _ethereumClientIntegrationFixture.GetWeb3();

            var deploymentMessage = new TestContractDeployment()
            {
                FromAddress = senderAddress
            };

            var deploymentHandler  = web3.Eth.GetContractDeploymentHandler <TestContractDeployment>();
            var transactionReceipt = await deploymentHandler.SendRequestAndWaitForReceiptAsync(deploymentMessage);

            var contractHandler = web3.Eth.GetContractHandler(transactionReceipt.ContractAddress);

            var returnSenderMessage = new ReturnSenderFunction()
            {
                FromAddress = senderAddress
            };

            var returnAddress = await contractHandler.QueryAsync <ReturnSenderFunction, string>(returnSenderMessage);

            Assert.Equal(senderAddress.ToLower(), returnAddress.ToLower());
        }