Coverage Summary for Class: BlockProcessor (co.rsk.net)
Class |
BlockProcessor$MockitoMock$310309384 |
BlockProcessor$MockitoMock$310309384$auxiliary$b1j16iIg |
BlockProcessor$MockitoMock$310309384$auxiliary$yHs3ZNlv |
Total |
1 /*
2 * This file is part of RskJ
3 * Copyright (C) 2017 RSK Labs Ltd.
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 package co.rsk.net;
20
21 import co.rsk.net.messages.NewBlockHashesMessage;
22 import org.ethereum.core.Block;
23 import org.ethereum.core.BlockHeader;
24
25 import java.util.List;
26
27 /**
28 * Created by ajlopez on 5/11/2016.
29 */
30 public interface BlockProcessor {
31 BlockProcessResult processBlock(Peer sender, Block block);
32
33 void processGetBlock(Peer sender, byte[] hash);
34
35 BlockNodeInformation getNodeInformation();
36
37 long getLastKnownBlockNumber();
38
39 void processNewBlockHashesMessage(Peer sender, NewBlockHashesMessage message);
40
41 void processBlockHeaders(Peer sender, List<BlockHeader> blockHeaders);
42
43 boolean hasBlock(byte[] hash);
44
45 boolean hasBlockInProcessorStore(byte[] hash);
46
47 boolean hasBlockInSomeBlockchain(byte[] hash);
48
49 boolean hasBetterBlockToSync();
50
51 boolean isAdvancedBlock(long number);
52
53 // New messages for RSK's sync protocol
54
55 void processBlockRequest(Peer sender, long requestId, byte[] hash);
56
57 void processBlockHeadersRequest(Peer sender, long requestId, byte[] hash, int count);
58
59 void processBodyRequest(Peer sender, long requestId, byte[] hash);
60
61 void processBlockHashRequest(Peer sender, long requestId, long height);
62
63 void processSkeletonRequest(Peer sender, long requestId, long startNumber);
64
65 boolean canBeIgnoredForUnclesRewards(long blockNumber);
66 }