Coverage Summary for Class: BlockValidatorRule (co.rsk.validators)
Class |
Class, %
|
Method, %
|
Line, %
|
BlockValidatorRule |
0%
(0/1)
|
0%
(0/2)
|
0%
(0/3)
|
1 package co.rsk.validators;
2
3 import org.ethereum.core.Block;
4
5 /**
6 * BlockValidatorRule performs all the validations needed for a block to be considered
7 * a reasonable continuation of the chain.
8 * This class performs **all** validations, in contrast with SyncBlockValidatorRule.
9 */
10 public class BlockValidatorRule implements BlockValidationRule {
11 private final BlockCompositeRule blockCompositeRule;
12
13 public BlockValidatorRule(TxsMinGasPriceRule txsMinGasPriceRule,
14 BlockUnclesValidationRule blockUnclesValidationRule,
15 BlockRootValidationRule blockRootValidationRule,
16 ProofOfWorkRule proofOfWorkRule,
17 RemascValidationRule remascValidationRule,
18 BlockTimeStampValidationRule blockTimeStampValidationRule,
19 GasLimitRule gasLimitRule,
20 ExtraDataRule extraDataRule,
21 ForkDetectionDataRule forkDetectionDataRule ) {
22 blockCompositeRule = new BlockCompositeRule(txsMinGasPriceRule,
23 blockUnclesValidationRule,
24 blockRootValidationRule,
25 proofOfWorkRule,
26 remascValidationRule,
27 blockTimeStampValidationRule,
28 gasLimitRule,
29 extraDataRule,
30 forkDetectionDataRule
31 );
32 }
33
34 public boolean isValid(Block block) {
35 return blockCompositeRule.isValid(block);
36 }
37
38 }