TransactionParseUtil extends TransactionUtil { public static Transaction parseTransactionBytes(final byte[] bytes) { return parseTransactionBytes(bytes, new Transaction()); } private  TransactionParseUtil(); static Transaction parseTransactionBytes(final byte[] bytes); static Transaction parseTransactionBytes(final byte[] bytes, final Transaction transaction); static Transaction parseTransactionBytes(final byte[] bytes, final Transaction transaction, final int initialPointer);  }
@Test public void testVersionBytes() throws DecoderException { final Transaction parsedTransaction = TransactionParseUtil.parseTransactionBytes(Hex.decode(TX_NORMAL_HEX)); Assert.assertEquals(1, parsedTransaction.getVersion()); }
@Test public void testInputSize() throws DecoderException { final Transaction parsedTransaction = TransactionParseUtil.parseTransactionBytes(Hex.decode(TX_NORMAL_HEX)); Assert.assertEquals(1, parsedTransaction.getInputSize().getValue()); Assert.assertEquals(1, parsedTransaction.getInputs().size()); }
@Test public void testScriptSize() throws DecoderException { final Transaction parsedTransaction = TransactionParseUtil.parseTransactionBytes(Hex.decode(TX_NORMAL_HEX)); Assert.assertEquals(108, parsedTransaction.getInputs().get(0).getScriptSize().getValue()); }