Skip to content

Commit

Permalink
minor pr fix
Browse files Browse the repository at this point in the history
  • Loading branch information
asoto-iov committed Nov 16, 2023
1 parent e3f26f9 commit 5a28036
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
4 changes: 2 additions & 2 deletions rskj-core/src/main/java/org/ethereum/facade/EthereumImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ public class EthereumImpl implements Ethereum {
private final CompositeEthereumListener compositeEthereumListener;
private final Blockchain blockchain;
private final GasPriceTracker gasPriceTracker;
private final Double minGasPriceMultiplier;
private final double minGasPriceMultiplier;

public EthereumImpl(
ChannelManager channelManager,
TransactionGateway transactionGateway,
CompositeEthereumListener compositeEthereumListener,
Blockchain blockchain,
GasPriceTracker gasPriceTracker,
Double minGasPriceMultiplier) {
double minGasPriceMultiplier) {
this.channelManager = channelManager;
this.transactionGateway = transactionGateway;

Expand Down
23 changes: 20 additions & 3 deletions rskj-core/src/test/java/org/ethereum/facade/EthereumImplTest.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
* This file is part of RskJ
* Copyright (C) 2023 RSK Labs Ltd.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.ethereum.facade;

import co.rsk.core.Coin;
Expand All @@ -21,17 +38,17 @@ void getGasPrice_returns_GasPriceTrackerValue_when_feeMarketWorking_is_true() {
when(gasPriceTracker.isFeeMarketWorking()).thenReturn(true);
when(gasPriceTracker.getGasPrice()).thenReturn(Coin.valueOf(10));

Ethereum ethereum = new EthereumImpl(null, null, new CompositeEthereumListener(), null, gasPriceTracker, null);
Ethereum ethereum = new EthereumImpl(null, null, new CompositeEthereumListener(), null, gasPriceTracker, 1);
Coin price = ethereum.getGasPrice();

assertEquals(10, price.asBigInteger().intValue());
}

@Test
void getGasPrice_returns_correctedBestBlockValue_when_feeMarketWorking_is_false(){
void getGasPrice_returns_correctedBestBlockValue_when_feeMarketWorking_is_false() {
GasPriceTracker gasPriceTracker = mock(GasPriceTracker.class);
Blockchain blockchain = mock(Blockchain.class);
Double minGasPriceMultiplier = 1.2;
double minGasPriceMultiplier = 1.2;
Block bestBlock = mock(Block.class);

when(gasPriceTracker.isFeeMarketWorking()).thenReturn(false);
Expand Down

0 comments on commit 5a28036

Please sign in to comment.