Skip to content

Commit

Permalink
fix tasks
Browse files Browse the repository at this point in the history
Signed-off-by: Brindrajsinh-Chauhan <brindrajsinh@gmail.com>
  • Loading branch information
Brindrajsinh-Chauhan committed Feb 19, 2024
1 parent 264b791 commit e28757e
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator;
import org.hyperledger.besu.ethereum.core.BlockchainSetupUtil;
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.ethereum.core.MiningParametersMetrics;
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.core.Transaction;
Expand Down Expand Up @@ -192,7 +193,8 @@ protected Map<String, JsonRpcMethod> getRpcMethods(
mock(EthPeers.class),
syncVertx,
mock(ApiConfiguration.class),
Optional.empty());
Optional.empty(),
mock(MiningParametersMetrics.class));
}

protected void startService() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator;
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.ethereum.core.MiningParametersMetrics;
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.eth.EthProtocol;
Expand Down Expand Up @@ -127,7 +128,8 @@ public void initServerAndClient() throws Exception {
mock(EthPeers.class),
vertx,
mock(ApiConfiguration.class),
Optional.empty());
Optional.empty(),
mock(MiningParametersMetrics.class));
service = createJsonRpcHttpService();
service.start().join();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator;
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.ethereum.core.MiningParametersMetrics;
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.eth.EthProtocol;
Expand Down Expand Up @@ -157,7 +158,8 @@ public static void initServerAndClient() throws Exception {
mock(EthPeers.class),
vertx,
mock(ApiConfiguration.class),
Optional.empty());
Optional.empty(),
mock(MiningParametersMetrics.class));
service = createJsonRpcHttpService();
jwtAuth = service.authenticationService.get().getJwtAuthProvider();
service.start().join();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.hyperledger.besu.ethereum.core.Block;
import org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider;
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.ethereum.core.MiningParametersMetrics;
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.ProtocolScheduleFixture;
import org.hyperledger.besu.ethereum.core.Synchronizer;
Expand Down Expand Up @@ -229,7 +230,8 @@ private JsonRpcHttpService createJsonRpcHttpServiceWithRpcApis(final JsonRpcConf
mock(EthPeers.class),
vertx,
mock(ApiConfiguration.class),
Optional.empty());
Optional.empty(),
mock(MiningParametersMetrics.class));
final JsonRpcHttpService jsonRpcHttpService =
new JsonRpcHttpService(
vertx,
Expand Down Expand Up @@ -337,7 +339,8 @@ private JsonRpcHttpService createJsonRpcHttpService(
mock(EthPeers.class),
vertx,
mock(ApiConfiguration.class),
Optional.empty());
Optional.empty(),
mock(MiningParametersMetrics.class));
final JsonRpcHttpService jsonRpcHttpService =
new JsonRpcHttpService(
vertx,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.hyperledger.besu.ethereum.chain.Blockchain;
import org.hyperledger.besu.ethereum.chain.ChainHead;
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.ethereum.core.MiningParametersMetrics;
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.eth.EthProtocol;
Expand Down Expand Up @@ -137,7 +138,8 @@ public static void initServerAndClient() throws Exception {
ethPeersMock,
vertx,
mock(ApiConfiguration.class),
Optional.empty());
Optional.empty(),
mock(MiningParametersMetrics.class));
disabledRpcMethods = new HashMap<>();
addedRpcMethods = new HashSet<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.hyperledger.besu.ethereum.api.tls.TlsConfiguration;
import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator;
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.ethereum.core.MiningParametersMetrics;
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.eth.EthProtocol;
Expand Down Expand Up @@ -141,7 +142,8 @@ public void initServer() throws Exception {
mock(EthPeers.class),
vertx,
mock(ApiConfiguration.class),
Optional.empty());
Optional.empty(),
mock(MiningParametersMetrics.class));

System.setProperty("javax.net.ssl.trustStore", CLIENT_AS_CA_CERT.getKeyStoreFile().toString());
System.setProperty(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.hyperledger.besu.ethereum.api.tls.TlsConfiguration;
import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator;
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.ethereum.core.MiningParametersMetrics;
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.eth.EthProtocol;
Expand Down Expand Up @@ -129,7 +130,8 @@ public void beforeEach() {
mock(EthPeers.class),
vertx,
mock(ApiConfiguration.class),
Optional.empty());
Optional.empty(),
mock(MiningParametersMetrics.class));
}

@AfterEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.hyperledger.besu.ethereum.api.tls.TlsConfiguration;
import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator;
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.ethereum.core.MiningParametersMetrics;
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.eth.EthProtocol;
Expand Down Expand Up @@ -130,7 +131,8 @@ public void initServer() throws Exception {
mock(EthPeers.class),
vertx,
mock(ApiConfiguration.class),
Optional.empty());
Optional.empty(),
mock(MiningParametersMetrics.class));
service = createJsonRpcHttpService(createJsonRpcConfig());
service.start().join();
baseUrl = service.url();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,21 @@
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType;
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.ethereum.core.MiningParametersMetrics;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.Mock;

public class MinerSetMinGasPriceTest {
MiningParameters miningParameters = MiningParameters.newDefault();
private MinerSetMinGasPrice method;

@Mock private MiningParametersMetrics miningParametersMetrics;

@BeforeEach
public void setUp() {
method = new MinerSetMinGasPrice(miningParameters);
method = new MinerSetMinGasPrice(miningParameters, miningParametersMetrics);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,21 @@
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType;
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.ethereum.core.MiningParametersMetrics;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.Mock;

public class MinerSetMinPriorityFeeTest {
MiningParameters miningParameters = MiningParameters.newDefault();
private MinerSetMinPriorityFee method;

@Mock private MiningParametersMetrics miningParametersMetrics;

@BeforeEach
public void setUp() {
method = new MinerSetMinPriorityFee(miningParameters);
method = new MinerSetMinPriorityFee(miningParameters, miningParametersMetrics);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.hyperledger.besu.ethereum.api.query.BlockchainQueries;
import org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator;
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.ethereum.core.MiningParametersMetrics;
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.eth.EthProtocol;
Expand Down Expand Up @@ -193,7 +194,8 @@ public void before() throws URISyntaxException {
mock(EthPeers.class),
vertx,
mock(ApiConfiguration.class),
Optional.empty()));
Optional.empty(),
mock(MiningParametersMetrics.class)));

websocketMethods.putAll(rpcMethods);
webSocketMessageHandlerSpy =
Expand Down

0 comments on commit e28757e

Please sign in to comment.