use of org.hyperledger.besu.ethereum.eth.manager.MockPeerConnection in project besu by hyperledger.
the class Istanbul99ProtocolManagerTest method setupPeer.
private MockPeerConnection setupPeer(final EthProtocolManager ethManager, final PeerSendHandler onSend) {
final MockPeerConnection peer = setupPeerWithoutStatusExchange(ethManager, onSend);
final StatusMessage statusMessage = StatusMessage.create(EthProtocol.EthVersion.V63, BigInteger.ONE, blockchain.getChainHead().getTotalDifficulty(), blockchain.getChainHeadHash(), blockchain.getBlockHeader(BlockHeader.GENESIS_BLOCK_NUMBER).get().getHash());
ethManager.processMessage(Istanbul99Protocol.ISTANBUL99, new DefaultMessage(peer, statusMessage));
return peer;
}
use of org.hyperledger.besu.ethereum.eth.manager.MockPeerConnection in project besu by hyperledger.
the class Istanbul99ProtocolManagerTest method setupPeerWithoutStatusExchange.
private MockPeerConnection setupPeerWithoutStatusExchange(final EthProtocolManager ethManager, final PeerSendHandler onSend) {
final Set<Capability> caps = new HashSet<>(Collections.singletonList(Istanbul99Protocol.ISTANBUL99));
final MockPeerConnection peer = new MockPeerConnection(caps, onSend);
ethManager.handleNewConnection(peer);
return peer;
}
Aggregations