@Test
public void completeContract() throws Exception {

    TxData pledgeTX1 = makePledge(details, 0.1);
    TxData pledgeTX2 = makePledge(details, 0.9);
    LHProtos.Pledge.Builder pledge1 = LHProtos.Pledge.newBuilder();
    pledge1.addTransactions(ByteString.copyFrom(pledgeTX1.pledge.bitcoinSerialize()));
    pledge1.getPledgeDetailsBuilder().setTotalInputValue((long) (Coin.COIN.longValue() * 0.1));
    pledge1.getPledgeDetailsBuilder().setTimestamp(Utils.currentTimeSeconds());
    pledge1.getPledgeDetailsBuilder().setProjectId("abc");
    pledge1.getPledgeDetailsBuilder();
    LHProtos.Pledge.Builder pledge2 = LHProtos.Pledge.newBuilder();
    pledge2.addTransactions(ByteString.copyFrom(pledgeTX2.pledge.bitcoinSerialize()));
    pledge2.getPledgeDetailsBuilder().setTotalInputValue((long) (Coin.COIN.longValue() * 0.9));
    pledge2.getPledgeDetailsBuilder().setTimestamp(Utils.currentTimeSeconds());
    pledge2.getPledgeDetailsBuilder().setProjectId("abc");
    pledge2.getPledgeDetailsBuilder();
    Project project = new Project(projectBuilder.build());
    Transaction contract = project.completeContract(ImmutableSet.of(pledge1.build(), pledge2.build()));
    assertEquals(2, contract.getInputs().size());
}