Search in sources :

Example 1 with ConfigCapabilitiesImpl

use of org.ethereum.net.client.ConfigCapabilitiesImpl in project rskj by rsksmart.

the class HandshakeHandlerTest method setup.

@Before
public void setup() {
    RskSystemProperties config = new TestSystemProperties();
    hhKey = config.getMyKey();
    handler = new HandshakeHandler(config, mock(PeerScoringManager.class), mock(P2pHandler.class), mock(MessageCodec.class), // this needs to be the real object so we can test changing the HELLO message
    new ConfigCapabilitiesImpl(config));
    channel = mock(Channel.class);
    when(channel.getNodeStatistics()).thenReturn(new NodeStatistics());
    // We don't pass the handler to the constructor to avoid calling HandshakeHandler.channelActive
    ch = new EmbeddedChannel();
    ch.pipeline().addLast(handler);
    ctx = ch.pipeline().firstContext();
}
Also used : NodeStatistics(org.ethereum.net.NodeStatistics) ConfigCapabilitiesImpl(org.ethereum.net.client.ConfigCapabilitiesImpl) EmbeddedChannel(io.netty.channel.embedded.EmbeddedChannel) Channel(org.ethereum.net.server.Channel) EmbeddedChannel(io.netty.channel.embedded.EmbeddedChannel) RskSystemProperties(co.rsk.config.RskSystemProperties) TestSystemProperties(co.rsk.config.TestSystemProperties) Before(org.junit.Before)

Aggregations

RskSystemProperties (co.rsk.config.RskSystemProperties)1 TestSystemProperties (co.rsk.config.TestSystemProperties)1 EmbeddedChannel (io.netty.channel.embedded.EmbeddedChannel)1 NodeStatistics (org.ethereum.net.NodeStatistics)1 ConfigCapabilitiesImpl (org.ethereum.net.client.ConfigCapabilitiesImpl)1 Channel (org.ethereum.net.server.Channel)1 Before (org.junit.Before)1