Package org.ethereum.net.eth

Examples of org.ethereum.net.eth.TransactionsMessage


            + "bbac02d830801c2aa94a4c9fa00b7907532b1f29c79942b75fff98822293bf5f"
            + "daa3653a8d9f424c6a3265f06c";
       
        byte[] payload = Hex.decode(txsPacketRaw);

        TransactionsMessage transactionsMessage = new TransactionsMessage(payload);
        System.out.println(transactionsMessage);

        assertEquals(EthMessageCodes.TRANSACTIONS, transactionsMessage.getCommand());
        assertEquals(1, transactionsMessage.getTransactions().size());

    Transaction tx = transactionsMessage.getTransactions().iterator().next();

    assertEquals("5d2aee0490a9228024158433d650335116b4af5a30b8abb10e9b7f9f7e090fd8", Hex.toHexString(tx.getHash()));
    assertEquals("04", Hex.toHexString(tx.getNonce()));
    assertEquals("1bc16d674ec80000", Hex.toHexString(tx.getValue()));
    assertEquals("cd2a3d9f938e13cd947ec05abc7fe734df8dd826", Hex.toHexString(tx.getReceiveAddress()));
View Full Code Here


                            + "c2cbdd4cf7afe15d9dbb8b75b748ba6791c9a01e87172a861f6c37b5a9e3a5d0"
                            + "d7393152a7fbe41530e5bb8ac8f35433e5931b";

        byte[] payload = Hex.decode(txsPacketRaw);

        TransactionsMessage transactionsMessage = new TransactionsMessage(payload);
        System.out.println(transactionsMessage);

        assertEquals(EthMessageCodes.TRANSACTIONS, transactionsMessage.getCommand());
       
        assertEquals(3, transactionsMessage.getTransactions().size());

        Iterator<Transaction> txIter = transactionsMessage.getTransactions().iterator();
        Transaction tx1 = txIter.next(); txIter.next(); // skip one
        Transaction tx3 = txIter.next();
       
        assertEquals("1b9d9456293cbcbc2f28a0fdc67028128ea571b033fb0e21d0ee00bcd6167e5d",
            Hex.toHexString(tx3.getHash()));
View Full Code Here

        tx.sign(privKey);
        tx.getEncoded();

        Set<Transaction> txs = new HashSet<>(Arrays.asList(tx));
        TransactionsMessage transactionsMessage = new TransactionsMessage(txs);

        assertEquals(EthMessageCodes.TRANSACTIONS, transactionsMessage.getCommand());
        assertEquals(expected, Hex.toHexString(transactionsMessage.getEncoded()));
    }
View Full Code Here

     * submit transaction to the network
     * @param tx - fresh transaction object
     */
    public void sendTransaction(Transaction tx ){

        TransactionsMessage msg = new TransactionsMessage(tx);
        msgQueue.sendMessage(msg);
    }
View Full Code Here

TOP

Related Classes of org.ethereum.net.eth.TransactionsMessage

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.