protected override BlockProcessor CreateBlockProcessor() { var validator = new AuRaParameters.Validator() { Addresses = TestItem.Addresses, ValidatorType = AuRaParameters.ValidatorType.List }; TransactionPermissionContractVersions = new LruCache <Keccak, UInt256>(PermissionBasedTxFilter.Cache.MaxCacheSize, nameof(TransactionPermissionContract)); var transactionPermissionContract = new VersionedTransactionPermissionContract(new AbiEncoder(), _contractAddress, 1, new ReadOnlyTxProcessorSource(DbProvider, BlockTree, SpecProvider, LimboLogs.Instance), TransactionPermissionContractVersions); TxPermissionFilterCache = new PermissionBasedTxFilter.Cache(); PermissionBasedTxFilter = new PermissionBasedTxFilter(transactionPermissionContract, TxPermissionFilterCache, State, LimboLogs.Instance); return(new AuRaBlockProcessor( SpecProvider, Always.Valid, new RewardCalculator(SpecProvider), TxProcessor, StateDb, CodeDb, State, Storage, TxPool, ReceiptStorage, LimboLogs.Instance, BlockTree, PermissionBasedTxFilter)); }
protected override BlockProcessor CreateBlockProcessor() { AuRaParameters.Validator validator = new() { Addresses = TestItem.Addresses, ValidatorType = AuRaParameters.ValidatorType.List }; TransactionPermissionContractVersions = new LruCache <Keccak, UInt256>(PermissionBasedTxFilter.Cache.MaxCacheSize, nameof(TransactionPermissionContract)); IReadOnlyTrieStore trieStore = new TrieStore(DbProvider.StateDb, LimboLogs.Instance).AsReadOnly(); IReadOnlyTxProcessorSource txProcessorSource = new ReadOnlyTxProcessingEnv( DbProvider, trieStore, BlockTree, SpecProvider, LimboLogs.Instance); VersionedTransactionPermissionContract transactionPermissionContract = new(AbiEncoder.Instance, _contractAddress, 1, new ReadOnlyTxProcessingEnv(DbProvider, trieStore, BlockTree, SpecProvider, LimboLogs.Instance), TransactionPermissionContractVersions, LimboLogs.Instance, SpecProvider); TxPermissionFilterCache = new PermissionBasedTxFilter.Cache(); PermissionBasedTxFilter = new PermissionBasedTxFilter(transactionPermissionContract, TxPermissionFilterCache, LimboLogs.Instance); return(new AuRaBlockProcessor( SpecProvider, Always.Valid, new RewardCalculator(SpecProvider), new BlockProcessor.BlockValidationTransactionsExecutor(TxProcessor, State), State, Storage, ReceiptStorage, LimboLogs.Instance, BlockTree, PermissionBasedTxFilter)); }