public async Task <IEnumerable <Transaction> > GetPostTransactionsAsync(
     IReadOnlyList <ServiceDescriptor> descriptors,
     ITransactionContext transactionContext)
 {
     return(transactionContext.Transaction.To ==
            _smartContractAddressService.GetAddressByContractName(ConsensusSmartContractAddressNameProvider.Name)
         ? await _transactionListProvider.GetTransactionListAsync()
         : new List <Transaction>());
 }
Пример #2
0
 public async Task <IEnumerable <Transaction> > GetPostTransactionsAsync(
     IReadOnlyList <ServiceDescriptor> descriptors,
     ITransactionContext transactionContext)
 {
     return(transactionContext.Transaction.To ==
            _smartContractAddressService.GetAddressByContractName(
                ConsensusSmartContractAddressNameProvider.Name) &&
            new List <string>
     {
         "FirstRound",
         "UpdateValue",
         "UpdateTinyBlockInformation",
         "NextRound",
         "NextTerm"
     }.Contains(transactionContext.Transaction.MethodName)
         ? await _transactionListProvider.GetTransactionListAsync()
         : new List <Transaction>());
 }
        public async Task <IEnumerable <Transaction> > GetPostTransactionsAsync(
            IReadOnlyList <ServiceDescriptor> descriptors,
            ITransactionContext transactionContext)
        {
            return(transactionContext.Transaction.To ==
                   await _smartContractAddressService.GetAddressByContractNameAsync(new ChainContext
            {
                BlockHash = transactionContext.PreviousBlockHash,
                BlockHeight = transactionContext.BlockHeight - 1,
                StateCache = transactionContext.StateCache
            }, ConsensusSmartContractAddressNameProvider.StringName) &&
                   new List <string>
            {
                "FirstRound",
                "UpdateValue",
                "UpdateTinyBlockInformation",
                "NextRound",
                "NextTerm"
            }

                   .Contains(transactionContext.Transaction.MethodName)
                ? await _transactionListProvider.GetTransactionListAsync()
                : new List <Transaction>());
        }
Пример #4
0
 public async Task <List <Transaction> > GetTransactionListAsync()
 {
     return(await _transactionListProvider.GetTransactionListAsync());
 }