test correct restore heights after closing wallet
What changed, and why it matters
This commit only updates test expectations in a Java test file. It changes three comments/assertions so that the test now expects a wallet's restore height to be remembered after closing, rather than expecting it to be lost. There is no production code change, no fix, and no security-relevant behavior introduced by this patch itself.
No security action needed. Review the underlying monero-project or monero-java wallet implementation separately if the goal is to confirm restore-height persistence behavior, since this commit only updates tests.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies src/test/java/TestMoneroWalletFull.java, replacing three assertions that expected getRestoreHeight() to return 0 after wallet close with assertions that expect the original restoreHeight value to persist. The previous comments/TODOs attributed the 0 behavior to the underlying monero-project implementation. This commit only adjusts tests to match new expected behavior; it does not alter wallet logic or the underlying Monero library.
Changed components
src/test/java/TestMoneroWalletFull.javaInspect captured patch +3 / −3
diff --git a/src/test/java/TestMoneroWalletFull.java b/src/test/java/TestMoneroWalletFull.java
index fde65c9..4275b2b 100644
--- a/src/test/java/TestMoneroWalletFull.java
+++ b/src/test/java/TestMoneroWalletFull.java
@@ -345,7 +345,7 @@ public class TestMoneroWalletFull extends TestMoneroWalletCommon {
assertFalse(wallet.isConnectedToDaemon());
assertFalse(wallet.isSynced());
assertEquals(1, wallet.getHeight());
- assertEquals(0, wallet.getRestoreHeight()); // restore height is lost after closing
+ assertEquals(restoreHeight, wallet.getRestoreHeight());
wallet.close();
// create wallet with seed, connection, and restore height
@@ -967,7 +967,7 @@ public class TestMoneroWalletFull extends TestMoneroWalletCommon {
assertEquals("English", wallet.getSeedLanguage());
assertFalse(wallet.isSynced());
assertEquals(1, wallet.getHeight());
- assertEquals(0, wallet.getRestoreHeight()); // TODO monero-project: restoreHeight is reset to 0 after closing
+ assertEquals(restoreHeight, wallet.getRestoreHeight());
// set the wallet's connection and sync
wallet.setDaemonConnection(TestUtils.getDaemonRpc().getRpcConnection());
@@ -991,7 +991,7 @@ public class TestMoneroWalletFull extends TestMoneroWalletCommon {
assertEquals(TestUtils.getDaemonRpc().getRpcConnection(), wallet.getDaemonConnection());
assertTrue(wallet.isConnectedToDaemon());
assertEquals(prevHeight, wallet.getHeight());
- assertEquals(0, wallet.getRestoreHeight()); // TODO monero-project: restoreHeight is reset to 0 after closing
+ assertEquals(restoreHeight, wallet.getRestoreHeight());
assertTrue(MoneroWalletFull.walletExists(path));
assertEquals(TestUtils.SEED, wallet.getSeed());
assertEquals(TestUtils.NETWORK_TYPE, wallet.getNetworkType());
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.