Skip to content

docs: add doc comments to all ink! messages in sanctions, version-reg… - #1066

Merged
nanaf6203-bit merged 1 commit into
MettaChain:mainfrom
abdoolyaro:docs/957-960-ink-message-doc-comments
Aug 25, 2026
Merged

docs: add doc comments to all ink! messages in sanctions, version-reg…#1066
nanaf6203-bit merged 1 commit into
MettaChain:mainfrom
abdoolyaro:docs/957-960-ink-message-doc-comments

Conversation

@abdoolyaro

@abdoolyaro abdoolyaro commented Aug 25, 2026

Copy link
Copy Markdown

…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.

…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.
@drips-wave

drips-wave Bot commented Aug 25, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@nanaf6203-bit nanaf6203-bit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nanaf6203-bit
nanaf6203-bit merged commit 4695fcc into MettaChain:main Aug 25, 2026
1 check 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

2 participants