Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Moving admin_peers to Admin API group #473

Merged
merged 1 commit into from
Dec 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ blockchainQueries, new TransactionTracer(blockReplay), parameter),
enabledMethods,
new NetVersion(protocolSchedule.getChainId()),
new NetListening(p2pNetwork),
new NetPeerCount(p2pNetwork),
new AdminPeers(p2pNetwork));
new NetPeerCount(p2pNetwork));
}
if (rpcApis.contains(RpcApis.WEB3)) {
addMethods(enabledMethods, new Web3ClientVersion(clientVersion), new Web3Sha3());
Expand All @@ -217,6 +216,9 @@ blockchainQueries, new TransactionTracer(blockReplay), parameter),
minerSetCoinbase,
new MinerSetEtherbase(minerSetCoinbase));
}
if (rpcApis.contains(RpcApis.ADMIN)) {
addMethods(enabledMethods, new AdminPeers(p2pNetwork));
}
// @formatter:off
return enabledMethods;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class RpcApis {
public static final RpcApi MINER = new RpcApi("MINER");
public static final RpcApi NET = new RpcApi("NET");
public static final RpcApi WEB3 = new RpcApi("WEB3");
public static final RpcApi ADMIN = new RpcApi("ADMIN");

public static final Collection<RpcApi> DEFAULT_JSON_RPC_APIS = Arrays.asList(ETH, NET, WEB3);

Expand All @@ -36,6 +37,8 @@ public static Optional<RpcApi> valueOf(final String name) {
return Optional.of(NET);
} else if (name.equals(WEB3.getCliValue())) {
return Optional.of(WEB3);
} else if (name.equals(ADMIN.getCliValue())) {
return Optional.of(ADMIN);
} else {
return Optional.empty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public class JsonRpcHttpServiceTest {
protected static BlockchainQueries blockchainQueries;
protected static Synchronizer synchronizer;
protected static final Collection<RpcApi> JSON_RPC_APIS =
Arrays.asList(RpcApis.ETH, RpcApis.NET, RpcApis.WEB3);
Arrays.asList(RpcApis.ETH, RpcApis.NET, RpcApis.WEB3, RpcApis.ADMIN);
protected final JsonRpcTestHelper testHelper = new JsonRpcTestHelper();

@BeforeClass
Expand Down