docs: add doc comments to all ink! messages in sanctions, version-reg… - #1066
Merged
nanaf6203-bit merged 1 commit intoAug 25, 2026
Merged
Conversation
…istry, prediction-market, fractional Closes MettaChain#957, MettaChain#958, MettaChain#959, MettaChain#960. - contracts/sanctions/lib.rs: doc comments for the 11 #[ink(message)] entry points that still lacked them (add_sanctioned_entity and remove_sanctioned_entity already had docs from a prior change on main; three newer messages -- set_max_sanctioned_entities, max_sanctioned_entities, active_entity_count -- also already had docs). Covers screening semantics, admin-gating, and notes honestly that screen_property's lookups are not constant-time. (The constant_time_sanctions module referenced in the original issue text has since been removed from this crate entirely by an unrelated upstream change, so that note has been updated to not reference a module that no longer exists.) Also fixes one unrelated, pre-existing bug found while verifying this file compiles: a missing closing brace in test_threshold_update_emits_sanction_threshold_updated_event was swallowing the following #[ink::test] fn header into its own body, leaving the file one short overall and preventing the crate from compiling at all on main prior to this change. This is a one-line syntax fix only -- no test logic, assertions, or behavior were changed. - contracts/version-registry/src/lib.rs: doc comments for all 6 #[ink(message)] entry points, pinning down auto-increment version semantics and how register_deployment_with_version can conflict with or skip ahead of it. - contracts/prediction-market/src/lib.rs: doc comments for the 8 previously-undocumented #[ink(message)] entry points (set_oracle, create_market, stake_prediction, resolve_market, claim_reward, get_user_reputation, get_market, submit_backtest_data), covering payable status, the reward formula, and the honest admin-driven (not oracle-verified) nature of resolve_market. - contracts/fractional/src/lib.rs: doc comments for the 4 #[ink(message)] entry points that had none (set_last_price, get_last_price, aggregate_portfolio, summarize_tax). Note: issue MettaChain#960 named bid_dutch_auction as one of the undocumented four, but it already carries doc comments in the code; the actual gap was in this unrelated group of price/portfolio/tax utility messages. All changes are additive /// doc comments only, except for the single brace fix noted above; no behavior, error variants, or public signatures were changed. Verified locally (Windows, pinned nightly toolchain) for all four packages: cargo doc -p propchain-sanctions --no-deps && cargo test -p propchain-sanctions (9 passed) cargo doc -p version-registry --no-deps && cargo test -p version-registry (8 passed) cargo doc -p propchain-prediction-market --no-deps && cargo test -p propchain-prediction-market (10 passed) cargo doc -p fractional --no-deps && cargo test -p fractional (50 passed) Rebuilt against current main (24fac29) after that verification to resolve a merge conflict in contracts/sanctions/lib.rs and to pick up the fix for the missing-brace bug described above; re-verify before merge.
|
@abdoolyaro 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.
…istry, prediction-market, fractional
contracts/sanctions/lib.rs: doc comments for the 11 #[ink(message)] entry points that still lacked them (add_sanctioned_entity and remove_sanctioned_entity already had docs from a prior change on main; three newer messages -- set_max_sanctioned_entities, max_sanctioned_entities, active_entity_count -- also already had docs). Covers screening semantics, admin-gating, and notes honestly that screen_property's lookups are not constant-time. (The constant_time_sanctions module referenced in the original issue text has since been removed from this crate entirely by an unrelated upstream change, so that note has been updated to not reference a module that no longer exists.)
Also fixes one unrelated, pre-existing bug found while verifying this file compiles: a missing closing brace in test_threshold_update_emits_sanction_threshold_updated_event was swallowing the following #[ink::test] fn header into its own body, leaving the file one short overall and preventing the crate from compiling at all on main prior to this change. This is a one-line syntax fix only -- no test logic, assertions, or behavior were changed.
contracts/version-registry/src/lib.rs: doc comments for all 6 #[ink(message)] entry points, pinning down auto-increment version semantics and how register_deployment_with_version can conflict with or skip ahead of it.
contracts/prediction-market/src/lib.rs: doc comments for the 8 previously-undocumented #[ink(message)] entry points (set_oracle, create_market, stake_prediction, resolve_market, claim_reward, get_user_reputation, get_market, submit_backtest_data), covering payable status, the reward formula, and the honest admin-driven (not oracle-verified) nature of resolve_market.
contracts/fractional/src/lib.rs: doc comments for the 4 #[ink(message)] entry points that had none (set_last_price, get_last_price, aggregate_portfolio, summarize_tax). Note: issue Document the fractional public API: 4 of 28 ink! messages lack doc comments #960 named bid_dutch_auction as one of the undocumented four, but it already carries doc comments in the code; the actual gap was in this unrelated group of price/portfolio/tax utility messages.
All changes are additive /// doc comments only, except for the single brace fix noted above; no behavior, error variants, or public signatures were changed.
Verified locally (Windows, pinned nightly toolchain) for all four packages:
cargo doc -p propchain-sanctions --no-deps && cargo test -p propchain-sanctions (9 passed)
cargo doc -p version-registry --no-deps && cargo test -p version-registry (8 passed)
cargo doc -p propchain-prediction-market --no-deps && cargo test -p propchain-prediction-market (10 passed)
cargo doc -p fractional --no-deps && cargo test -p fractional (50 passed)
Rebuilt against current main (24fac29) after that verification to
resolve a merge conflict in contracts/sanctions/lib.rs and to pick up
the fix for the missing-brace bug described above; re-verify before
merge.
Closes #957,
Closes #958,
Closes #959,
Closes #960.