Project { public Transaction fastSanityCheck(LHProtos.Pledge pledge) { if (pledge.getTransactionsList().isEmpty()) throw new Ex.NoTransactionData(); Transaction tx = LHUtils.pledgeToTx(params, pledge); if (tx.getOutputs().size() != outputs.size()) throw new Ex.TxWrongNumberOfOutputs(tx.getOutputs().size(), outputs.size()); for (int i = 0; i < tx.getOutputs().size(); i++) { if (!outputs.get(i).duplicateDetached().equals(tx.getOutput(i).duplicateDetached())) throw new Ex.OutputMismatch(); } tx.verify(); return tx; } Project(LHProtos.ProjectDetails details);  Project(LHProtos.Project proto); static LHProtos.ProjectDetails.Builder makeDetails(NetworkParameters params, String title, String memo, Address to, Coin value, DeterministicKey authKey, int lookaheadSize); LHProtos.Project getProto(); LHProtos.ProjectDetails getProtoDetails(); String getID(); Sha256Hash getIDHash(); boolean isServerAssisted(); String getTitle(); String getEmail(); String getMemo(); Coin getGoalAmount(); ByteString getCoverImage(); List<TransactionOutput> getOutputs(); Instant getExpires(); boolean isExpired(); @Nullable URI getPaymentURL(); CompletableFuture<LHProtos.Pledge> verifyPledge(UTXOSource peer, LHProtos.Pledge pledge); Transaction fastSanityCheck(LHProtos.Pledge pledge); Transaction completeContract(Set<LHProtos.Pledge> pledges); CompletableFuture<LHProtos.ProjectStatus> getStatus(PledgingWallet wallet, @Nullable KeyParameter key); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); String getSuggestedFileName(); static String getSuggestedFileName(String title); Coin getMinPledgeAmount(); static Coin getMinPledgeAmountFrom(long minPledgeAmount); @Nullable String signAsOwner(PledgingWallet wallet, String message, @Nullable KeyParameter aesKey); void authenticateOwner(String message, String signatureBase64); byte[] getAuthKey(); int getAuthKeyIndex(); NetworkParameters getParams(); static final int COVER_IMAGE_WIDTH; static final int COVER_IMAGE_HEIGHT; static String GET_STATUS_USER_AGENT; }
@Test(expected = VerificationException.DuplicatedOutPoint.class) public void duplicatedOutpoints() throws Exception { TxData pledgeTX = makePledge(details, 0.1); pledgeTX.pledge.addInput(pledgeTX.pledge.getInput(0).duplicateDetached()); Project project = new Project(projectBuilder.build()); project.fastSanityCheck(pledgeToBuilder(pledgeTX, true).build()); }