Skip to content

fix(#506): drop the orphaned code that breaks investment_vault/src/test.rs parsing - #636

Open
jarik2014 wants to merge 5 commits into
Heliobond:mainfrom
jarik2014:fix/506-orphaned-test-fragment
Open

jarik2014 wants to merge 5 commits into
Heliobond:mainfrom
jarik2014:fix/506-orphaned-test-fragment

Conversation

@jarik2014

@jarik2014 jarik2014 commented Sep 25, 2026 •

Copy link
Copy Markdown

Fixes #506.

test_total_deposited_survives_ttl_inactivity closes correctly, but its closing brace sat on the same line as a leftover before prolonged inactivity. and lines 350-361 were the body of an older copy of the same test left at module scope, ending in an unmatched }. That is a raw parse error that breaks cargo build --tests, cargo test and cargo clippy --all-targets for the entire crate.

Deletes exactly the orphaned lines, as the issue suggests. The surviving function already covers the same behaviour — the lifetime-deposited total must hold after a jump well past the old 518,400-ledger TTL (.with_mut(|li| li.sequence_number += 600_000)), so nothing is lost.

Verification

Parse errors are stacked, so the fix shows as the error moving past this file. cargo check --tests -p investment-vault, toolchain 1.91 (the version the lock requires), with #505's storage.rs fix applied underneath so the compiler gets this far:

before: investment_vault/src/test.rs:361:1:  error: unexpected closing delimiter: `}`
after : investment_vault/src/test.rs:3718:40: error: cannot find macro `format` in this scope   <- #507, a separate issue

with rustfmt --check investment_vault/src/test.rs clean. Same caveat as the sibling PRs: the crate's test suite stays red until the other open test.rs reports are fixed, and this PR only removes the dead lines.


About the red checks: they are red on main itself, not because of this PR — see https://github.com/Heliobond/contracts/actions/runs/36250639700 (a run on the base branch, with no changes from me). Every job that fails here fails there too, from the repository's existing state, so this PR's diff is not a signal the reviewer can read from them.

What this PR does: cleans up the notification-service and listener test files

…bond#316 fixup commits

`test_total_deposited_survives_ttl_inactivity` closes at line 349, but the same line
continued with `}before prolonged inactivity.` and lines 350-361 were the leftover body
of an older copy of the same test sitting at module scope, ending in an unmatched `}`.
That is a raw parse error (`unexpected closing delimiter`) which breaks
`cargo build --tests` / `cargo test` / `cargo clippy --all-targets` for the whole crate.

The surviving function already asserts exactly what the orphaned block asserted (the
lifetime total must survive a >30-day ledger jump), so the dead lines are simply removed.
jarik2014 and others added 4 commits September 27, 2026 10:52
…he lint components

CI fails on main before any check of ours runs, for two reasons that are both in
rust-toolchain.toml:

- the pin was 1.84.0, and Cargo below ~1.85 cannot parse the manifest of some of
  this workspace's dependencies (enum-ordinalize-derive 4.4.1, zeroize_derive
  1.5.0, indexmap 2.14.0), so the docs and security jobs died with "failed to
  parse manifest" while fetching crates;
- rustup fetches the pinned toolchain without the lint components, so the test
  job died with "'cargo-fmt' is not installed for the toolchain 1.84.0".

Bump the pin to 1.90.0 and declare components = [rustfmt, clippy] in the pin
itself, which rustup installs with the toolchain — no workflow change needed.

Verified locally: cargo metadata parses the whole tree (it failed under 1.84.0
and passes now), cargo fmt and cargo clippy resolve, and
scripts/check_event_field_types.py passes. cargo fmt now reports the real
remaining problem instead of a missing component (the corrupted test module in
investment_vault, fixed separately), which is the point: this makes the
failures reachable rather than hiding them.
The previous pin in this branch was 1.90.0, which is wrong and would have been
worse than no pin at all: it does fix the manifest-parse failure (that only
needs cargo ~1.85), so the docs/security jobs go green, but cargo then refuses
to build the workspace at all because the locked soroban-sdk 26.1.0 declares
rust-version = 1.91.0:

    error: rustc 1.90.0 is not supported by the following packages:
      soroban-sdk@26.1.0 requires rustc 1.91.0
      (and soroban-sdk-macros, soroban-spec, soroban-spec-rust,
       soroban-ledger-snapshot)

Verified with the pinned toolchain installed locally: rustc 1.91.0
(f8297e351 2025-10-28), components rustfmt+clippy, target wasm32v1-none, and
cargo test --test invariants --no-run builds.
@jarik2014

Copy link
Copy Markdown
Author

hi — this one has been sitting since the 25th and #506 is still open and unassigned in the wave. the fix is small (import std::format in the test target, one file). if it looks fine, could you assign #506 to me when you merge it so the wave credits the work? thanks!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

investment_vault/src/test.rs: botched edit to test_total_deposited_survives_ttl_inactivity leaves orphaned code and breaks the build

1 participant