Skip to content

API: add a version(): u32 for on-chain upgrades - #1682

Merged
Baskarayelu merged 1 commit into
Remitwise-Org:mainfrom
greatest0fallt1me:feat/1621-version-getter
Jul 30, 2026
Merged

API: add a version(): u32 for on-chain upgrades#1682
Baskarayelu merged 1 commit into
Remitwise-Org:mainfrom
greatest0fallt1me:feat/1621-version-getter

Conversation

@greatest0fallt1me

Copy link
Copy Markdown
Contributor

Summary

emergency_killswitch had no way for off-chain tooling to check which build it is talking to, unlike several sibling contracts (bill_payments, remittance_split, savings_goals, family_wallet, insurance, orchestrator) which already expose get_version().

Change

  • Add pub const CONTRACT_VERSION: u32 = 1.
  • Add pub fn version(env: Env) -> u32, a read-only view requiring no auth, returning CONTRACT_VERSION.

Purely additive — no existing entrypoint changed.

Tests

Added version_returns_contract_version_without_init, asserting it's callable before initialize() and returns the constant.

cargo test -p emergency_killswitch: 37 passed, 0 failed.

Closes #1621

Adds a CONTRACT_VERSION constant and a version() -> u32 view function so
off-chain upgrade tooling can confirm which WASM build a deployed
instance is running, matching the pattern already used by sibling
contracts (bill_payments::get_version, etc).
@Baskarayelu
Baskarayelu merged commit 8babe8c into Remitwise-Org:main Jul 30, 2026
6 of 7 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.

API: add a version(): u32 for on-chain upgrades

2 participants