test: close test gaps in version-registry, mock-oracle, common and fees - #1054
Merged
nanaf6203-bit merged 1 commit intoAug 25, 2026
Conversation
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
|
@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! 🚀 |
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.
Summary
Closes the unit/integration test gaps called out for version-registry (#1009), mock-oracle (#1010), common (#1011) and fees (#1012).
What's covered
register_deployment_with_version: out-of-order versions (100 then 2) keep both records + correctlatest_versionswithout corruptingnext_version; zero-version rejection; duplicate rejection; history ordering across gapstests/integration_mock_oracle.rs: pushed-price lifecycle (set/set-batch/reset/reset_all), admin gates, consumer reads through the oracle trait, valuation-request history/snapshotsCargo.toml+ lib scaffolding); extends cache tests: round-trip, recompute-after-invalidate, dirty-key ordering, eviction semantics, SCALE encode→decode byte-identical stabilitysrc/tests.rs(wired viainclude!, module renamedfee_teststo avoid collision with errors.rs's sibling) + premium-auction lifecycle: fee booked into treasury on create,BidTooLow/AuctionEnded/AuctionNotEndedrejections, winner recorded, treasury totals assertedNotes
DynamicFeeConfigliterals toBasisPoints::new(...)(test-code only).mock-oraclegains"rlib"in crate-type so the tests crate can link it (same pattern asfractional).Testing
cargo test -p version-registry→ 13 passedcargo test -p propchain-fees→ 36 passedcargo test -p propchain-common→ 12 passedcargo test -p propchain-tests→ 36 passed (16 new integration tests)Closes #1009
Closes #1010
Closes #1011
Closes #1012