Skip to content

Commit 9cc99a3

Browse files
agutierrez0Angel Gutierrez
andauthored
#517 AccountDeleteIT (#568)
* create new test file for account delete * create test for tecTOO_SOON case * create test for temDST_IS_SRC case * create test for tecDST_TAG_NEEDED use case * create test for tecNO_DST use case * create use case for tecNO_PERMISSION use case * create test for tecHAS_OBLIGATIONS use case * use xrplAdminClient to accept ledger instead of submitting txs * address checkstyle issues * change position of @DisabledIf --------- Co-authored-by: Angel Gutierrez <[email protected]>
1 parent 374cb09 commit 9cc99a3

File tree

5 files changed

+413
-20
lines changed

5 files changed

+413
-20
lines changed

xrpl4j-integration-tests/src/test/java/org/xrpl/xrpl4j/tests/AbstractIT.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,26 @@ private KeyStore loadKeyStore() {
703703
return JavaKeystoreLoader.loadFromClasspath(jksFileName, jksPassword);
704704
}
705705

706+
/**
707+
* Returns the minimum time that can be used for escrow expirations. The ledger will not accept an expiration time
708+
* that is earlier than the last ledger close time, so we must use the latter of current time or ledger close time
709+
* (which for unexplained reasons can sometimes be later than now).
710+
*
711+
* @return An {@link Instant}.
712+
*/
713+
protected Instant getMinExpirationTime() {
714+
LedgerResult result = getValidatedLedger();
715+
Instant closeTime = xrpTimestampToInstant(
716+
result.ledger().closeTime()
717+
.orElseThrow(() ->
718+
new RuntimeException("Ledger close time must be present to calculate a minimum expiration time.")
719+
)
720+
);
721+
722+
Instant now = Instant.now();
723+
return closeTime.isBefore(now) ? now : closeTime;
724+
}
725+
706726
private void logAccountCreation(Address address) {
707727
logger.info("Generated wallet with ClassicAddress={})", address);
708728
}

0 commit comments

Comments
 (0)