Ensured that the transaction statistics endpoint is exposed. (#1330)

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
Rob Dawson 6 years ago committed by GitHub
parent 2637e0004e
commit 4f6a26828d
  1. 5
      ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/JsonRpcMethodsFactory.java
  2. 8
      ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/results/PendingTransactionsStatisticsResult.java

@ -73,6 +73,7 @@ import tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.NetPeerCount;
import tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.NetServices;
import tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.NetVersion;
import tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.RpcModules;
import tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.TxPoolPantheonStatistics;
import tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.TxPoolPantheonTransactions;
import tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.Web3ClientVersion;
import tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.Web3Sha3;
@ -286,7 +287,9 @@ public class JsonRpcMethodsFactory {
}
if (rpcApis.contains(RpcApis.TX_POOL)) {
addMethods(
enabledMethods, new TxPoolPantheonTransactions(transactionPool.getPendingTransactions()));
enabledMethods,
new TxPoolPantheonTransactions(transactionPool.getPendingTransactions()),
new TxPoolPantheonStatistics(transactionPool.getPendingTransactions()));
}
if (rpcApis.contains(RpcApis.PERM)) {
addMethods(

@ -12,7 +12,7 @@
*/
package tech.pegasys.pantheon.ethereum.jsonrpc.internal.results;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonGetter;
public class PendingTransactionsStatisticsResult {
@ -27,17 +27,17 @@ public class PendingTransactionsStatisticsResult {
this.remoteCount = remoteCount;
}
@JsonValue
@JsonGetter
public long getMaxSize() {
return maxSize;
}
@JsonValue
@JsonGetter
public long getLocalCount() {
return localCount;
}
@JsonValue
@JsonGetter
public long getRemoteCount() {
return remoteCount;
}

Loading…
Cancel
Save