Exemple #1
0
        internal async Task <Chain> CreateChainWithGenesisContractAsync()
        {
            _defaultContractZeroCodeProvider.SetDefaultContractZeroRegistrationByType(null);
            var chain = await _kernelTestHelper.CreateChain();

            var transaction = BuildDeploySystemSmartContractTransaction(ZeroSmartContractAddressNameProvider.Name,
                                                                        Codes["AElf.Contracts.Genesis"]);
            var block = await _blockchainService.GetBlockByHashAsync(chain.BestChainHash);

            block.Body.TransactionIds.Add(transaction.GetHash());
            await _blockchainService.AddTransactionsAsync(new[] { transaction });

            await MineBlockAsync(block);

            return(chain);
        }