@@ -95,6 +95,17 @@ public void createAndFinishTimeBasedEscrow() throws JsonRpcClientErrorException,
9595 createResult .transactionResult ().hash ()
9696 );
9797
98+ //////////////////////
99+ // Then wait until the transaction gets committed to a validated ledger
100+ TransactionResult <EscrowCreate > result = this .scanForResult (
101+ () -> this .getValidatedTransaction (createResult .transactionResult ().hash (), EscrowCreate .class )
102+ );
103+
104+ assertEntryEqualsObjectFromAccountObjects (
105+ senderKeyPair .publicKey ().deriveAddress (),
106+ escrowCreate .sequence ()
107+ );
108+
98109 //////////////////////
99110 // Wait until the close time on the current validated ledger is after the finishAfter time on the Escrow
100111 this .scanForResult (
@@ -108,11 +119,6 @@ public void createAndFinishTimeBasedEscrow() throws JsonRpcClientErrorException,
108119 )
109120 );
110121
111- assertEntryEqualsObjectFromAccountObjects (
112- senderKeyPair .publicKey ().deriveAddress (),
113- escrowCreate .sequence ()
114- );
115-
116122 //////////////////////
117123 // Receiver submits an EscrowFinish transaction to release the Escrow funds
118124 AccountInfoResult receiverAccountInfo = this .scanForResult (
@@ -195,6 +201,17 @@ public void createAndFinishTimeBasedEscrowToSelf() throws JsonRpcClientErrorExce
195201 createResult .transactionResult ().hash ()
196202 );
197203
204+ //////////////////////
205+ // Then wait until the transaction gets committed to a validated ledger
206+ this .scanForResult (
207+ () -> this .getValidatedTransaction (createResult .transactionResult ().hash (), EscrowCreate .class )
208+ );
209+
210+ assertEntryEqualsObjectFromAccountObjects (
211+ senderKeyPair .publicKey ().deriveAddress (),
212+ escrowCreate .sequence ()
213+ );
214+
198215 //////////////////////
199216 // Wait until the close time on the current validated ledger is after the finishAfter time on the Escrow
200217 this .scanForResult (
@@ -208,11 +225,6 @@ public void createAndFinishTimeBasedEscrowToSelf() throws JsonRpcClientErrorExce
208225 )
209226 );
210227
211- assertEntryEqualsObjectFromAccountObjects (
212- senderKeyPair .publicKey ().deriveAddress (),
213- escrowCreate .sequence ()
214- );
215-
216228 //////////////////////
217229 // Receiver submits an EscrowFinish transaction to release the Escrow funds
218230 final AccountInfoResult preEscrowFinishSenderAccountInfo = this .scanForResult (
@@ -438,6 +450,17 @@ public void createAndCancelTimeBasedEscrowToSelf() throws JsonRpcClientErrorExce
438450 createResult .transactionResult ().hash ()
439451 );
440452
453+ //////////////////////
454+ // Then wait until the transaction gets committed to a validated ledger
455+ TransactionResult <EscrowCreate > result = this .scanForResult (
456+ () -> this .getValidatedTransaction (createResult .transactionResult ().hash (), EscrowCreate .class )
457+ );
458+
459+ assertEntryEqualsObjectFromAccountObjects (
460+ senderKeyPair .publicKey ().deriveAddress (),
461+ escrowCreate .sequence ()
462+ );
463+
441464 //////////////////////
442465 // Wait until the close time on the current validated ledger is after the finishAfter time on the Escrow
443466 this .scanForResult (
@@ -451,11 +474,6 @@ public void createAndCancelTimeBasedEscrowToSelf() throws JsonRpcClientErrorExce
451474 )
452475 );
453476
454- assertEntryEqualsObjectFromAccountObjects (
455- senderKeyPair .publicKey ().deriveAddress (),
456- escrowCreate .sequence ()
457- );
458-
459477 //////////////////////
460478 // Receiver submits an EscrowFinish transaction to release the Escrow funds
461479 final AccountInfoResult preEscrowFinishSenderAccountInfo = this .scanForResult (
@@ -539,6 +557,17 @@ public void createAndFinishCryptoConditionBasedEscrow() throws JsonRpcClientErro
539557 createResult .transactionResult ().hash ()
540558 );
541559
560+ //////////////////////
561+ // Then wait until the transaction gets committed to a validated ledger
562+ this .scanForResult (
563+ () -> this .getValidatedTransaction (createResult .transactionResult ().hash (), EscrowCreate .class )
564+ );
565+
566+ assertEntryEqualsObjectFromAccountObjects (
567+ senderKeyPair .publicKey ().deriveAddress (),
568+ escrowCreate .sequence ()
569+ );
570+
542571 //////////////////////
543572 // Wait until the close time on the current validated ledger is after the finishAfter time on the Escrow
544573 this .scanForResult (
@@ -552,11 +581,6 @@ public void createAndFinishCryptoConditionBasedEscrow() throws JsonRpcClientErro
552581 )
553582 );
554583
555- assertEntryEqualsObjectFromAccountObjects (
556- senderKeyPair .publicKey ().deriveAddress (),
557- escrowCreate .sequence ()
558- );
559-
560584 //////////////////////
561585 // Execute the escrow using the secret fulfillment known only to the appropriate party.
562586 AccountInfoResult receiverAccountInfo = this .scanForResult (
0 commit comments