Coverage Summary for Class: TransactionPool (org.ethereum.core)
Class |
TransactionPool$MockitoMock$963094022 |
TransactionPool$MockitoMock$963094022$auxiliary$gTXz7CiK |
TransactionPool$MockitoMock$963094022$auxiliary$PScgBymi |
Total |
1 /*
2 * This file is part of RskJ
3 * Copyright (C) 2017 RSK Labs Ltd.
4 * (derived from ethereumJ library, Copyright (c) 2016 <ether.camp>)
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 package org.ethereum.core;
21
22 import co.rsk.config.InternalService;
23 import co.rsk.core.bc.PendingState;
24
25 import java.util.List;
26
27 public interface TransactionPool extends InternalService {
28 /**
29 * Adds transaction to the list of pending or queued state txs <br>
30 * Triggers an update of pending state
31 *
32 * Doesn't broadcast transaction to active peers
33 *
34 * @param tx transaction
35 */
36 TransactionPoolAddResult addTransaction(Transaction tx);
37
38 /**
39 * Adds a list of transactions to the list of pending state txs or
40 * queued transactions
41 *
42 * Triggers an update of pending state
43 *
44 * Doesn't broadcast transaction to active peers
45 *
46 * @param txs transaction list
47 *
48 * @return the list of added transactions
49 */
50 List<Transaction> addTransactions(List<Transaction> txs);
51
52 /**
53 * It should be called on each block imported as <b>BEST</b> <br>
54 * Does several things:
55 * <ul>
56 * <li>removes block's txs from pending state and wire lists</li>
57 * <li>removes outdated pending txs</li>
58 * <li>updates pending state</li>
59 * </ul>
60 *
61 * @param block block imported into blockchain as a <b>BEST</b> one
62 */
63 void processBest(Block block);
64
65 void removeTransactions(List<Transaction> txs);
66
67 /**
68 * @return list of pending transactions (ready to be executed)
69 */
70 List<Transaction> getPendingTransactions();
71
72 // Returns a list of queued txs (out of nonce sequence)
73 List<Transaction> getQueuedTransactions();
74
75 /**
76 * @return pending state
77 */
78 PendingState getPendingState();
79 }