Skip to content

Add regression test for the contract version() view - #635

Merged
Abdulazeem-code merged 1 commit into
Abdulazeem-code:mainfrom
Tijesunimi004:feat/contract-versioning
Aug 29, 2026
Merged

Add regression test for the contract version() view#635
Abdulazeem-code merged 1 commit into
Abdulazeem-code:mainfrom
Tijesunimi004:feat/contract-versioning

Conversation

@Tijesunimi004

Copy link
Copy Markdown
Contributor

Addresses #269.

Context

Both acceptance criteria for #269 are already satisfied on main:

  • PaymentRouter::VERSIONconst VERSION: u32 = 1; (payment_router/src/lib.rs:222)
  • PaymentRouter::version()pub fn version(_env: Env) -> u32 { Self::VERSION }, an exposed read-only view (payment_router/src/lib.rs:1133)

These landed alongside the timelock work but were never given test coverage, and the issue is still open.

Change

Adds test_version_reports_contract_version, which asserts that version() is callable without initialization and returns the compiled-in version (PaymentRouter::VERSION, i.e. 1). One file, test-only, no production code touched.

cargo test — 42 passed, 0 failed (43 with the 3 pre-existing #[ignore]d cases).

Not addressed here

cargo fmt --check and cargo clippy -D warnings already fail on main (formatting drift in the timelock code, and a large backlog of doc_markdown/pedantic findings), so the "Static security analysis" check will stay red. The committed Cargo.lock and test_snapshots/*.json are also stale relative to main's own code. All of that is unrelated to this change and belongs in its own maintenance PR. The added test lines are rustfmt-clean.

The version() view and VERSION constant already exist; this adds a
regression test covering issue Abdulazeem-code#269's acceptance criteria: version() is
callable without initialization and returns the compiled-in version.
Copilot AI lite review requested due to automatic review settings August 29, 2026 16:03
@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

Hey @Tijesunimi004! 👋 It looks like this PR isn't linked to any issue.

If this PR is for one of the issues assigned to you as part of a Wave, please link it to ensure your contribution is tracked properly. You can do this by adding a keyword to the PR description (e.g., Closes #123), or by clicking a button below:

Issue Title
#613 Add support for username aliases (multiple usernames per address) Link to this issue
#587 Eliminate duplicate shouldFallbackToLocalRegistry implementations Link to this issue
#604 Add contract tests for the federation protocol (SEP-0002 compliance) Link to this issue

ℹ️ Learn more about linking PRs to issues

@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

@Tijesunimi004 is attempting to deploy a commit to the Abdulazeem's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Abdulazeem-code
Abdulazeem-code merged commit 3bff195 into Abdulazeem-code:main Aug 29, 2026
8 of 10 checks passed
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.

3 participants