Skip to content

Commit

Permalink
Merge pull request #29 from Consensys/bump-plugin-api-compat
Browse files Browse the repository at this point in the history
Update for besu 24.12.x
  • Loading branch information
garyschulte authored Dec 13, 2024
2 parents 33f240b + 7c0f073 commit 8c2dbfa
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
releaseVersion=0.3.2
besuVersion=24.10.0
releaseVersion=0.4.0
besuVersion=24.12.1

2 changes: 1 addition & 1 deletion gradle/versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ dependencyManagement {
}

// junit
dependencySet(group: 'org.junit.jupiter', version: '5.8.2') {
dependencySet(group: 'org.junit.jupiter', version: '5.11.2') {
entry 'junit-jupiter'
entry 'junit-jupiter-api'
entry 'junit-jupiter-engine'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import java.util.List;

import com.google.auto.service.AutoService;
import org.hyperledger.besu.plugin.BesuContext;
import org.hyperledger.besu.plugin.BesuPlugin;
import org.hyperledger.besu.plugin.ServiceManager;
import org.hyperledger.besu.plugin.services.RpcEndpointService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -32,13 +32,13 @@ public class BesuShomeiRpcPlugin implements BesuPlugin {
private static final Logger LOG = LoggerFactory.getLogger(BesuShomeiRpcPlugin.class);

@Override
public void register(final BesuContext context) {
public void register(final ServiceManager serviceManager) {
LOG.debug("Registering RPC plugins");
var methods =
List.of(
new ShomeiGetTrieLogsByRange(ZkTrieLogService.getInstance()),
new ShomeiGetTrieLog(ZkTrieLogService.getInstance()));
context
serviceManager
.getService(RpcEndpointService.class)
.ifPresent(
rpcEndpointService ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import java.util.Optional;

import com.google.auto.service.AutoService;
import org.hyperledger.besu.plugin.BesuContext;
import org.hyperledger.besu.plugin.BesuPlugin;
import org.hyperledger.besu.plugin.ServiceManager;
import org.hyperledger.besu.plugin.services.PicoCLIOptions;
import org.hyperledger.besu.plugin.services.TrieLogService;
import org.slf4j.Logger;
Expand All @@ -31,19 +31,19 @@ public class ZkTrieLogPlugin implements BesuPlugin {
private static ShomeiCliOptions options = ShomeiCliOptions.create();

@Override
public void register(final BesuContext besuContext) {
public void register(final ServiceManager serviceManager) {
LOG.info("Registering ZkTrieLog plugin");

LOG.debug("Adding command line params");
final Optional<PicoCLIOptions> cmdlineOptions = besuContext.getService(PicoCLIOptions.class);
final Optional<PicoCLIOptions> cmdlineOptions = serviceManager.getService(PicoCLIOptions.class);

if (cmdlineOptions.isEmpty()) {
throw new IllegalStateException(
"Expecting a PicoCLI options to register CLI options with, but none found.");
}

cmdlineOptions.get().addPicoCLIOptions(NAME, options);
besuContext.addService(TrieLogService.class, ZkTrieLogService.getInstance());
serviceManager.addService(TrieLogService.class, ZkTrieLogService.getInstance());
}

@Override
Expand Down

0 comments on commit 8c2dbfa

Please sign in to comment.