Package org.ethereum.net.p2p

Examples of org.ethereum.net.p2p.P2pHandler


    }

    @Test
    public void test4(){

        P2pHandler p2pHandler = new P2pHandler();

    List<Capability> capabilities = Arrays.asList(
        new Capability(Capability.ETH, EthHandler.VERSION),
        new Capability(Capability.SHH, ShhHandler.VERSION));
        p2pHandler.adaptMessageIds(capabilities);

        Assert.assertEquals(0x10 + 0, EthMessageCodes.STATUS.asByte());
        Assert.assertEquals(0x10 + 1, EthMessageCodes.GET_TRANSACTIONS.asByte());
        Assert.assertEquals(0x10 + 2, EthMessageCodes.TRANSACTIONS.asByte());
        Assert.assertEquals(0x10 + 3, EthMessageCodes.GET_BLOCK_HASHES.asByte());
View Full Code Here


    }

    @Test // Capabilities should be read in alphabetical order
    public void test5(){

        P2pHandler p2pHandler = new P2pHandler();

    List<Capability> capabilities = Arrays.asList(
        new Capability(Capability.SHH, ShhHandler.VERSION),
        new Capability(Capability.ETH, EthHandler.VERSION));
        p2pHandler.adaptMessageIds(capabilities);

        Assert.assertEquals(0x10 + 0, EthMessageCodes.STATUS.asByte());
        Assert.assertEquals(0x10 + 1, EthMessageCodes.GET_TRANSACTIONS.asByte());
        Assert.assertEquals(0x10 + 2, EthMessageCodes.TRANSACTIONS.asByte());
        Assert.assertEquals(0x10 + 3, EthMessageCodes.GET_BLOCK_HASHES.asByte());
View Full Code Here

TOP

Related Classes of org.ethereum.net.p2p.P2pHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.