コード例 #1
0
        public bool TryGetValue(BlockHeader header, T key, out T value)
        {
            GetItemsFromContractAtBlock(header);
            IDictionaryContractDataStoreCollection <T> collection = ((IDictionaryContractDataStoreCollection <T>)(ContractDataStore.Collection));

            return(collection.TryGetValue(key, out value));
        }
コード例 #2
0
 private static ContractDataStore <T> CreateContractDataStore(
     IDictionaryContractDataStoreCollection <T> collection,
     IDataContract <T> dataContract,
     IBlockTree blockTree,
     IReceiptFinder receiptFinder,
     ILogManager logManager) =>
 new ContractDataStore <T>(collection, dataContract, blockTree, receiptFinder, logManager);
コード例 #3
0
 public DictionaryContractDataStore(
     IDictionaryContractDataStoreCollection <T> collection,
     IDataContract <T> dataContract,
     IBlockTree blockTree,
     IReceiptFinder receiptFinder,
     ILogManager logManager)
     : this(CreateContractDataStore(collection, dataContract, blockTree, receiptFinder, logManager))
 {
 }
コード例 #4
0
 public DictionaryContractDataStore(
     IDictionaryContractDataStoreCollection <T> collection,
     IDataContract <T> dataContract,
     IBlockTree blockTree,
     IReceiptFinder receiptFinder,
     ILogManager logManager,
     ILocalDataSource <IEnumerable <T> > localDataSource)
     : this(localDataSource == null
         ? CreateContractDataStore(collection, dataContract, blockTree, receiptFinder, logManager)
         : CreateContractDataStoreWithLocalData(collection, dataContract, blockTree, receiptFinder, logManager, localDataSource))
 {
 }
コード例 #5
0
 private static ContractDataStoreWithLocalData <T> CreateContractDataStoreWithLocalData(
     IDictionaryContractDataStoreCollection <T> collection,
     IDataContract <T> dataContract,
     IBlockTree blockTree,
     IReceiptFinder receiptFinder,
     ILogManager logManager,
     ILocalDataSource <IEnumerable <T> > localDataSource) =>
 new ContractDataStoreWithLocalData <T>(
     collection,
     dataContract ?? new EmptyDataContract <T>(),
     blockTree,
     receiptFinder,
     logManager,
     localDataSource);