Beispiel #1
0
        public IEnumerable <GenesisSmartContractDto> GetGenesisSmartContractDtos()
        {
            var contractCode   = _contractCodeProvider.Codes;
            var deploymentList = _contractDeploymentListProvider.GetDeployContractNameList();

            return(_contractInitializationProviders
                   .Where(p => deploymentList.Contains(p.SystemSmartContractName))
                   .OrderBy(p => deploymentList.IndexOf(p.SystemSmartContractName))
                   .Select(p =>
            {
                var code = contractCode[p.ContractCodeName];
                var methodList = p.GetInitializeMethodList(code);
                var genesisSmartContractDto = new GenesisSmartContractDto
                {
                    Code = code,
                    SystemSmartContractName = p.SystemSmartContractName,
                    ContractInitializationMethodCallList = new List <ContractInitializationMethodCall>()
                };
                foreach (var method in methodList)
                {
                    genesisSmartContractDto.AddGenesisTransactionMethodCall(method);
                }

                return genesisSmartContractDto;
            }));
        }