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

Commit

Permalink
rename to TX Pool Pantheon Transactions and added group. (#1095)
Browse files Browse the repository at this point in the history
  • Loading branch information
rojotek authored Mar 18, 2019
1 parent a0c6666 commit bec1239
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
import tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.NetPeerCount;
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.TxPoolPendingTransactions;
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;
import tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.miner.MinerSetCoinbase;
Expand Down Expand Up @@ -249,8 +249,11 @@ blockchainQueries, new TransactionTracer(blockReplay), parameter),
new MinerStart(miningCoordinator),
new MinerStop(miningCoordinator),
minerSetCoinbase,
new MinerSetEtherbase(minerSetCoinbase),
new TxPoolPendingTransactions(transactionPool.getPendingTransactions()));
new MinerSetEtherbase(minerSetCoinbase));
}
if (rpcApis.contains(RpcApis.TX_POOL)) {
addMethods(
enabledMethods, new TxPoolPantheonTransactions(transactionPool.getPendingTransactions()));
}
if (rpcApis.contains(RpcApis.PERM)) {
addMethods(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class RpcApis {
public static final RpcApi WEB3 = new RpcApi("WEB3");
public static final RpcApi ADMIN = new RpcApi("ADMIN");
public static final RpcApi EEA = new RpcApi("EEA");
public static final RpcApi TX_POOL = new RpcApi("TXPOOL");

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

Expand All @@ -46,6 +47,8 @@ public static Optional<RpcApi> valueOf(final String name) {
return Optional.of(ADMIN);
} else if (name.equals(EEA.getCliValue())) {
return Optional.of(EEA);
} else if (name.equals(TX_POOL.getCliValue())) {
return Optional.of(TX_POOL);
} else {
return Optional.empty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
import tech.pegasys.pantheon.ethereum.jsonrpc.internal.response.JsonRpcSuccessResponse;
import tech.pegasys.pantheon.ethereum.jsonrpc.internal.results.PendingTransactionsResult;

public class TxPoolPendingTransactions implements JsonRpcMethod {
public class TxPoolPantheonTransactions implements JsonRpcMethod {

private final PendingTransactions pendingTransactions;

public TxPoolPendingTransactions(final PendingTransactions pendingTransactions) {
public TxPoolPantheonTransactions(final PendingTransactions pendingTransactions) {
this.pendingTransactions = pendingTransactions;
}

@Override
public String getName() {
return "pantheon_txpool_pendingTransactions";
return "txpool_pantheonTransactions";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@
import org.mockito.junit.MockitoJUnitRunner;

@RunWith(MockitoJUnitRunner.class)
public class TxPoolPendingTransactionsTest {
public class TxPoolPantheonTransactionsTest {

@Mock private PendingTransactions pendingTransactions;
private TxPoolPendingTransactions method;
private TxPoolPantheonTransactions method;
private final String JSON_RPC_VERSION = "2.0";
private final String TXPOOL_PENDING_TRANSACTIONS_METHOD = "pantheon_txpool_pendingTransactions";
private final String TXPOOL_PENDING_TRANSACTIONS_METHOD = "txpool_pantheonTransactions";
private static final String TRANSACTION_HASH =
"0xbac263fb39f2a51053fb5e1e52aeb4e980fba9e151aa7e4f12eca95a697aeac9";

@Before
public void setUp() {
method = new TxPoolPendingTransactions(pendingTransactions);
method = new TxPoolPantheonTransactions(pendingTransactions);
}

@Test
Expand Down

0 comments on commit bec1239

Please sign in to comment.