Add regression test for the contract version() view - #635
Merged
Abdulazeem-code merged 1 commit intoAug 29, 2026
Merged
Conversation
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.
|
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.,
|
|
@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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #269.
Context
Both acceptance criteria for #269 are already satisfied on
main:PaymentRouter::VERSION—const 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 thatversion()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 --checkandcargo clippy -D warningsalready fail onmain(formatting drift in the timelock code, and a large backlog ofdoc_markdown/pedantic findings), so the "Static security analysis" check will stay red. The committedCargo.lockandtest_snapshots/*.jsonare also stale relative tomain's own code. All of that is unrelated to this change and belongs in its own maintenance PR. The added test lines arerustfmt-clean.