private IRepository <PublicEntryDao, string> PopulateTransactionRepository(ILifetimeScope scope,
                                                                                   out string id,
                                                                                   out IEnumerable <PublicEntryDao> publicEntryDaoList)
        {
            var transactionRepository = scope.Resolve <IRepository <PublicEntryDao, string> >();

            var transaction = TransactionHelper.GetPublicTransaction().PublicEntry.ToDao <PublicEntry, PublicEntryDao>(_mapperProvider);

            id = transaction.Id;

            publicEntryDaoList = PublicEntryHelper.GetPublicEntriesDao(10);

            transaction = publicEntryDaoList.First();

            var signingContextDao = new SigningContextDao
            {
                NetworkType   = NetworkType.Devnet,
                SignatureType = SignatureType.TransactionPublic
            };

            transaction.Signature = new SignatureDao
            {
                RawBytes = "mplwifwfjfw", SigningContext = signingContextDao
            };

            transactionRepository.Add(transaction);

            return(transactionRepository);
        }
Esempio n. 2
0
        private IRepository <TransactionBroadcastDao, string> PopulateTransactBroadcastRepo(ILifetimeScope scope,
                                                                                            out string Id,
                                                                                            out IEnumerable <ContractEntryDao> contractEntryDaoList,
                                                                                            out IEnumerable <PublicEntryDao> publicEntryDaoList)
        {
            var transactBroadcastRepo = scope.Resolve <IRepository <TransactionBroadcastDao, string> >();

            var transactionBroadcastDao = new TransactionBroadcastDao().ToDao(TransactionHelper.GetPublicTransaction());

            transactionBroadcastDao.Id = Guid.NewGuid().ToString();
            Id = transactionBroadcastDao.Id;

            transactionBroadcastDao.ContractEntries = ContractEntryHelper.GetContractEntriesDao(10);
            contractEntryDaoList = transactionBroadcastDao.ContractEntries;

            transactionBroadcastDao.PublicEntries = PublicEntryHelper.GetPublicEntriesDao(10);
            publicEntryDaoList = transactionBroadcastDao.PublicEntries;

            var signingContextDao = new SigningContextDao
            {
                NetworkType   = NetworkType.Devnet,
                SignatureType = SignatureType.TransactionPublic
            };

            transactionBroadcastDao.ConfidentialEntries = ConfidentialEntryHelper.GetConfidentialEntriesDao(10);

            transactionBroadcastDao.Signature = new SignatureDao {
                RawBytes = "mplwifwfjfw", SigningContext = signingContextDao
            };

            transactBroadcastRepo.Add(transactionBroadcastDao);

            return(transactBroadcastRepo);
        }