Skip to content

test: close test gaps in version-registry, mock-oracle, common and fees - #1054

Merged
nanaf6203-bit merged 1 commit into
MettaChain:mainfrom
OladipupuHussein7:feature/tests-version-registry-mock-oracle-common-fees
Aug 25, 2026
Merged

test: close test gaps in version-registry, mock-oracle, common and fees#1054
nanaf6203-bit merged 1 commit into
MettaChain:mainfrom
OladipupuHussein7:feature/tests-version-registry-mock-oracle-common-fees

Conversation

@OladipupuHussein7

Copy link
Copy Markdown
Contributor

Summary

Closes the unit/integration test gaps called out for version-registry (#1009), mock-oracle (#1010), common (#1011) and fees (#1012).

What's covered

Issue Crate Coverage
#1009 version-registry register_deployment_with_version: out-of-order versions (100 then 2) keep both records + correct latest_versions without corrupting next_version; zero-version rejection; duplicate rejection; history ordering across gaps
#1010 mock-oracle new tests/integration_mock_oracle.rs: pushed-price lifecycle (set/set-batch/reset/reset_all), admin gates, consumer reads through the oracle trait, valuation-request history/snapshots
#1011 common registers the orphaned crate in the workspace (Cargo.toml + lib scaffolding); extends cache tests: round-trip, recompute-after-invalidate, dirty-key ordering, eviction semantics, SCALE encode→decode byte-identical stability
#1012 fees revives the dead src/tests.rs (wired via include!, module renamed fee_tests to avoid collision with errors.rs's sibling) + premium-auction lifecycle: fee booked into treasury on create, BidTooLow/AuctionEnded/AuctionNotEnded rejections, winner recorded, treasury totals asserted

Notes

  • Fixing compile errors in the previously-uncompiled fees test file required updating four DynamicFeeConfig literals to BasisPoints::new(...) (test-code only).
  • mock-oracle gains "rlib" in crate-type so the tests crate can link it (same pattern as fractional).

Testing

  • cargo test -p version-registry → 13 passed
  • cargo test -p propchain-fees → 36 passed
  • cargo test -p propchain-common → 12 passed
  • cargo test -p propchain-tests → 36 passed (16 new integration tests)

Closes #1009
Closes #1010
Closes #1011
Closes #1012

Unit/integration coverage for four crates per their tracking issues:

- Version registry (MettaChain#1009): register_deployment_with_version with
  out-of-order versions (100 then 2) keeps both records and
  get_latest_version correctness without corrupting the sequential
  counter; zero-version rejection leaves state untouched; duplicate
  high-version rejection; history ordering across gaps.
- Mock oracle (MettaChain#1010): new tests/integration_mock_oracle.rs module —
  pushed-price lifecycle (set_price/set_prices/reset/reset_all), admin
  gates (reset/transfer_admin), consumer reads through the oracle trait,
  valuation-request history/snapshots for priced properties only, and
  is_mock_enabled truthfully reflecting the feature-off build.
- Common (MettaChain#1011): registers the orphaned contracts/common crate in the
  workspace (new Cargo.toml + lib.rs scaffolding) and extends cache.rs
  tests: insert/retrieve round-trip, get_or_insert_with recompute-after-
  invalidate semantics, dirty-key ordering across multiple keys,
  invalidate/invalidate_all eviction behavior, len/is_empty, and a
  SCALE encode->decode byte-identical round-trip pinning value-format
  stability.
- Fees (MettaChain#1012): revives the dead src/tests.rs file (wired via
  include!("tests.rs"), renamed fee_tests to avoid colliding with the
  sibling mod from errors.rs) and adds the premium-auction lifecycle:
  create books the fee into fee_treasury, bids below minimum/current bid
  rejected with BidTooLow, bids after end_time rejected with AuctionEnded,
  settle before end rejected with AuctionNotEnded, settle without bids
  fails, and full lifecycle recording winner + treasury totals.

Note: fixing compile errors in the previously-uncompiled fees tests.rs
required updating four DynamicFeeConfig literals to BasisPoints::new(...)
(test-code-only). mock-oracle gains "rlib" in crate-type so the tests
crate can link it (same pattern as fractional).

All suites green: version-registry 13, fees 36, common 12,
propchain-tests 36 passed.

Closes MettaChain#1009
Closes MettaChain#1010
Closes MettaChain#1011
Closes MettaChain#1012
@drips-wave

drips-wave Bot commented Aug 25, 2026

Copy link
Copy Markdown

@OladipupuHussein7 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@nanaf6203-bit
nanaf6203-bit merged commit 68f386b into MettaChain:main Aug 25, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment