Skip to content

Commit

Permalink
#517 AccountDeleteIT (#568)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
agutierrez0 and Angel Gutierrez authored Nov 18, 2024
1 parent 374cb09 commit 9cc99a3
Show file tree
Hide file tree
Showing 5 changed files with 413 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,26 @@ private KeyStore loadKeyStore() {
return JavaKeystoreLoader.loadFromClasspath(jksFileName, jksPassword);
}

/**
* Returns the minimum time that can be used for escrow expirations. The ledger will not accept an expiration time
* that is earlier than the last ledger close time, so we must use the latter of current time or ledger close time
* (which for unexplained reasons can sometimes be later than now).
*
* @return An {@link Instant}.
*/
protected Instant getMinExpirationTime() {
LedgerResult result = getValidatedLedger();
Instant closeTime = xrpTimestampToInstant(
result.ledger().closeTime()
.orElseThrow(() ->
new RuntimeException("Ledger close time must be present to calculate a minimum expiration time.")
)
);

Instant now = Instant.now();
return closeTime.isBefore(now) ? now : closeTime;
}

private void logAccountCreation(Address address) {
logger.info("Generated wallet with ClassicAddress={})", address);
}
Expand Down
Loading

0 comments on commit 9cc99a3

Please sign in to comment.