use of co.rsk.config.GasLimitConfig in project rskj by rsksmart.
the class BlockToMineBuilderTest method setUp.
@Before
public void setUp() {
validationRules = mock(BlockValidationRule.class);
RepositoryLocator repositoryLocator = mock(RepositoryLocator.class);
StateRootHandler stateRootHandler = mock(StateRootHandler.class);
MiningConfig miningConfig = mock(MiningConfig.class);
DifficultyCalculator difficultyCalculator = mock(DifficultyCalculator.class);
MinimumGasPriceCalculator minimumGasPriceCalculator = mock(MinimumGasPriceCalculator.class);
MinerUtils minerUtils = mock(MinerUtils.class);
activationConfig = mock(ActivationConfig.class);
blockExecutor = mock(BlockExecutor.class);
blockBuilder = new BlockToMineBuilder(activationConfig, miningConfig, repositoryLocator, mock(BlockStore.class), mock(TransactionPool.class), difficultyCalculator, new GasLimitCalculator(Constants.mainnet()), new ForkDetectionDataCalculator(), validationRules, mock(MinerClock.class), new BlockFactory(activationConfig), blockExecutor, minimumGasPriceCalculator, minerUtils);
BlockDifficulty blockDifficulty = mock(BlockDifficulty.class);
Repository snapshot = mock(Repository.class);
GasLimitConfig gasLimitConfig = new GasLimitConfig(0, 0, false);
when(minerUtils.getAllTransactions(any())).thenReturn(new ArrayList<>());
when(minerUtils.filterTransactions(any(), any(), any(), any(), any())).thenReturn(new ArrayList<>());
when(repositoryLocator.snapshotAt(any())).thenReturn(snapshot);
when(minimumGasPriceCalculator.calculate(any())).thenReturn(mock(Coin.class));
when(stateRootHandler.translate(any())).thenReturn(TestUtils.randomHash());
when(miningConfig.getGasLimit()).thenReturn(gasLimitConfig);
when(miningConfig.getUncleListLimit()).thenReturn(10);
when(miningConfig.getCoinbaseAddress()).thenReturn(TestUtils.randomAddress());
when(difficultyCalculator.calcDifficulty(any(), any())).thenReturn(blockDifficulty);
}
Aggregations