예제 #1
0
        public async void MulticallTestStruct()
        {
            var web3 = _ethereumClientIntegrationFixture.GetWeb3();
            var deploymentReceipt = await web3.Eth.GetContractDeploymentHandler <TestContractDeployment>()
                                    .SendRequestAndWaitForReceiptAsync();

            var deploymentReceiptMulticall = await web3.Eth.GetContractDeploymentHandler <MulticallDeployment>()
                                             .SendRequestAndWaitForReceiptAsync();

            var getTestFunction1 = new GetTestFunction();
            var call1            = new MulticallInputOutput <GetTestFunction, GetTestFunctionOuptputDTO>(getTestFunction1,
                                                                                                         deploymentReceipt.ContractAddress);

            var getTestFunction2 = new GetTestFunction();
            var call2            = new MulticallInputOutput <GetTestFunction, GetTestFunctionOuptputDTO>(getTestFunction2,
                                                                                                         deploymentReceipt.ContractAddress);

            await web3.Eth.GetMultiQueryHandler(deploymentReceiptMulticall.ContractAddress)
            .MultiCallAsync(call1, call2);

            Assert.Equal(5, call1.Output.Test1);
            Assert.Equal(5, call2.Output.Test1);
        }
예제 #2
0
 public Task <GetTestOutputDTO> GetTestQueryAsync(GetTestFunction getTestFunction, BlockParameter blockParameter = null)
 {
     return(ContractHandler.QueryDeserializingToObjectAsync <GetTestFunction, GetTestOutputDTO>(getTestFunction, blockParameter));
 }