Skip to content

feat: per-contract version() view returning semver string#590

Merged
greatest0fallt1me merged 29 commits into
CalloraOrg:mainfrom
GBOYEE:task/version-view
Jun 29, 2026
Merged

feat: per-contract version() view returning semver string#590
greatest0fallt1me merged 29 commits into
CalloraOrg:mainfrom
GBOYEE:task/version-view

Conversation

@GBOYEE

@GBOYEE GBOYEE commented Jun 28, 2026

Copy link
Copy Markdown

Summary

Adds read-only version() view to all three contracts returning the Cargo package version embedded at compile time via `env!("CARGO_PKG_VERSION")", enabling off-chain tooling to detect capability deltas after upgrades.

Changes

  • contracts/vault/src/lib.rs: added version() → returns "0.0.1"
  • contracts/settlement/src/lib.rs: added version() → returns "0.1.0"
  • contracts/revenue_pool/src/lib.rs: added version() → returns "0.0.1"
  • Tests added to each contract's test_views.rs

Testing

  • version_returns_semver_string test in vault, settlement, revenue_pool test suites

Closes #562

root added 28 commits June 28, 2026 14:42
Adds read-only version() view to all three contracts:
- vault: returns callora-vault Cargo version
- settlement: returns callora-settlement Cargo version
- revenue_pool: returns callora-revenue-pool Cargo version

Uses env!("CARGO_PKG_VERSION") for compile-time embedding.
Includes focused tests in each contract's test suite.

Closes CalloraOrg#562
- Remove duplicate get_storage_ttl from settlement
- Remove broken address/token/last_address code block
- Add missing type defs: StorageEntryTtl, Severity, AdminBroadcast, PendingDeveloperMigration
- Add missing StorageKey variants: DeveloperBalanceV1, StorageVersion, PendingDeveloperMigration
- Add missing imports: String, contracterror
- Remove duplicate #[contractimpl] in vault, merge functions into first block
- Fix migrate.rs DeveloperBalance 1-arg mismatch
- Fix cargo fmt violations across settlement and revenue_pool
…feature

- Restore lib.rs, test.rs and test modules from b3d2e5f (last working state
  before PR CalloraOrg#579 broke the build with -X theirs merge that removed module
  declarations for admin, errors, timelock, types, limits)
- Add Checkpoint struct and StorageKey::Checkpoint/CheckpointCounter variants
- Add checkpoint() admin entrypoint and current_checkpoint() getter
- SettlementError now re-exported from errors module (full enum with all variants)

Fixes: \CalloraOrg#567
@greatest0fallt1me greatest0fallt1me merged commit 652ddf9 into CalloraOrg:main Jun 29, 2026
3 of 6 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.

Add per-contract version() view returning semver string

2 participants