@Test
public void claim() throws Exception {
// Check the wallet notices when its pledge has been claimed and understands the current state.
WalletTestObjects objects1 = new WalletTestObjects(() -> new PledgingWallet(UnitTestParams.get()));
PledgingWallet wallet1 = (PledgingWallet) objects1.wallet;
Project project = new Project(makeProject(wallet1, 1_000_000));
objects1.sendAmounts(1_000_000);
PledgingWallet.PendingPledge ppledge1 = wallet1.createPledge(project, 500_000, null);
LHProtos.Pledge pledge1 = ppledge1.commit(true);
{
final MockTransactionBroadcaster.TxFuturePair txFuturePair = objects1.broadcaster.waitForTxFuture();
txFuturePair.succeed();
}
WalletTestObjects objects2 = new WalletTestObjects(() -> new PledgingWallet(UnitTestParams.get()));
PledgingWallet wallet2 = (PledgingWallet) objects2.wallet;
objects2.sendAmounts(1_000_000);
PledgingWallet.PendingPledge ppledge2 = wallet2.createPledge(project, 500_000, null);
LHProtos.Pledge pledge2 = ppledge2.commit(true);
{
final MockTransactionBroadcaster.TxFuturePair txFuturePair = objects2.broadcaster.waitForTxFuture();
txFuturePair.succeed();