Ejemplo n.º 1
0
        public async Task Executor_Factory_Deploys_Child_Contract()
        {
            var inactivePeriod = TimeSpan.FromDays(50).Seconds;
            var bounty         = 1000;

            var contract = await ExecutorFactory.DeployFactoryAsync(_web3Geth, _contractInfo);

            var createExecutorFunction = contract.GetFunction("createExecutor");

            var gas = await createExecutorFunction.EstimateGasAsync(
                Credentials.Sender, Credentials.BackupAddress, inactivePeriod, bounty);

            var txHash = await createExecutorFunction.SendTransactionAsync(
                Credentials.Sender, new HexBigInteger(gas.Value), new HexBigInteger(0),
                Credentials.Sender, Credentials.BackupAddress, inactivePeriod, bounty);

            var receipt = await Miner.MineAndGetReceiptAsync(_web3Geth, txHash);

            var countFunction = contract.GetFunction("getExecutorsCount");
            var exesCount     = await countFunction.CallAsync <int>();

            Assert.Equal(1, exesCount);
        }