diff --git a/xrpl4j-integration-tests/src/test/java/org/xrpl/xrpl4j/tests/environment/RippledContainer.java b/xrpl4j-integration-tests/src/test/java/org/xrpl/xrpl4j/tests/environment/RippledContainer.java index 38fcb1694..f75ee9145 100644 --- a/xrpl4j-integration-tests/src/test/java/org/xrpl/xrpl4j/tests/environment/RippledContainer.java +++ b/xrpl4j-integration-tests/src/test/java/org/xrpl/xrpl4j/tests/environment/RippledContainer.java @@ -65,10 +65,20 @@ public class RippledContainer { LOGGER.warn("Ledger accept failed", e); } }; + + private void acceptCurrentLedger(RippledContainer rippledContainer) { + try { + AcceptLedgerResult status = rippledContainer.getXrplAdminClient().acceptLedger(); + LOGGER.info("Accepted ledger status: {}", status); + } catch (RuntimeException | JsonRpcClientErrorException e) { + LOGGER.warn("Ledger accept failed", e); + } + } + private final GenericContainer rippledContainer; private final ScheduledExecutorService ledgerAcceptor; private boolean started; - + /** * No-args constructor. */ @@ -121,7 +131,8 @@ public RippledContainer start(int acceptIntervalMillis) { ledgerAcceptor.scheduleAtFixedRate(() -> LEDGER_ACCEPTOR.accept(this), acceptIntervalMillis, acceptIntervalMillis, - TimeUnit.MILLISECONDS); + TimeUnit.MILLISECONDS + ); waitForLedgerTimeToSync(); return this; } @@ -197,6 +208,6 @@ public HttpUrl getBaseUri() { */ public void acceptLedger() { assertContainerStarted(); - LEDGER_ACCEPTOR.accept(this); + this.acceptCurrentLedger(this); } }