  @Test
  public void testNewTxInput() throws Exception {


    // Arrange
    Address ourReceivingAddress = FakeTransactions.getElectrumAddressN(new int[] {0,0});
    Address ourChangeAddress = FakeTransactions.getElectrumAddressN(new int[] {0,1});
    Address random2Address = FakeTransactions.asMainNetAddress("1MKw8vWxvBnaBcrL2yXvZceqyRMoeG2kRn");

    // Build a fake transaction
    Transaction tx = FakeTransactions.newMainNetFakeTx(
      ourReceivingAddress,
      ourChangeAddress,
      random2Address,
      BigInteger.TEN,
      BigInteger.ONE
    );

    byte[] expectedPrevHash = new byte[] {-37, 34, -99, 85, -58, 79, 11, -8, 14, 64, 35, -18, 54, 14, -46, -43, -91, -66, 98, -68, 117, 99, 67, 49, -63, 86, -77, -75, -115, -122, 69, -43};
    byte[] expectedScriptSig = new byte[] {};

    // Act
    TrezorMessage.TxInput txInput = TrezorMessageUtils.newTxInput(tx, 0);

    // Assert
    assertThat(txInput.getAmount()).isEqualTo(BigInteger.TEN.longValue());

    assertThat(txInput.getPrevHash().toByteArray()).isEqualTo(expectedPrevHash);
    assertThat(txInput.getPrevIndex()).isEqualTo(0);
    assertThat(txInput.getScriptSig().toByteArray()).isEqualTo(expectedScriptSig);

  }