// Unconsumed stack items are not allowed.
TxData pledgeTX = makePledge(details, 0.1);
TransactionInput input = pledgeTX.pledge.getInput(0);
TransactionOutput origOutput = pledgeTX.fakeStub.getOutput(0);
Script p2shPK = ScriptBuilder.createP2SHOutputScript(origOutput.getScriptPubKey());
Script p2shSS = new ScriptBuilder(input.getScriptSig()).data(origOutput.getScriptBytes()).data(0, new byte[]{}).build();
input.setScriptSig(p2shSS);
pledgeTX.fakeStub.clearOutputs();
pledgeTX.fakeStub.addOutput(origOutput.getValue(), p2shPK);
LHProtos.Pledge.Builder pledge = pledgeToBuilder(pledgeTX, false);
Project project = new Project(projectBuilder.build());