Skip to content

[N-05] Collections audit - #494

Merged
ericnordelo merged 2 commits into
mainfrom
fix/collections-audit-N-05
Jul 17, 2026
Merged

[N-05] Collections audit#494
ericnordelo merged 2 commits into
mainfrom
fix/collections-audit-N-05

Conversation

@ericnordelo

@ericnordelo ericnordelo commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Order book placements now reject zero-sized bids and asks.
    • Approval and revocation events now identify the associated allowlist.
    • Unlock events now identify the queue that emitted them.
  • Bug Fixes

    • Improved event accuracy and context for allowlist and unlock-queue operations.
  • Tests

    • Added coverage for zero-size order rejection and verified event payloads and ordering.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f9de5721-258b-494b-a66f-d53c20592fbf

📥 Commits

Reviewing files that changed from the base of the PR and between 15eb9ac and 0ae65d9.

📒 Files selected for processing (6)
  • collections/examples/sorted_map/order_book.move
  • collections/examples/sorted_map/tests/order_book_tests.move
  • collections/examples/sorted_set/allowlist.move
  • collections/examples/sorted_set/tests/allowlist_tests.move
  • collections/examples/sorted_set/tests/unlock_queue_tests.move
  • collections/examples/sorted_set/unlock_queue.move

📝 Walkthrough

Walkthrough

The PR rejects zero-sized order placements and adds originating object identifiers to allowlist and unlock queue events. Tests now verify abort codes, exact event payloads, and queue event ordering.

Changes

Order book validation

Layer / File(s) Summary
Zero-size placement guards
collections/examples/sorted_map/order_book.move
Adds EZeroSize, documents positive level sizes, and rejects zero-sized asks and bids before map updates.
Zero-size rejection tests
collections/examples/sorted_map/tests/order_book_tests.move
Adds expected-failure tests for zero-sized ask and bid placements.

Allowlist event identity

Layer / File(s) Summary
Allowlist event payloads
collections/examples/sorted_set/allowlist.move
Adds allowlist_id to approval and revocation events and populates it from the allowlist object ID.
Allowlist event assertions
collections/examples/sorted_set/tests/allowlist_tests.move
Verifies exact approval and revocation payloads and adds coverage for strict approval of a new ID.

Unlock queue event identity

Layer / File(s) Summary
Queue event payloads
collections/examples/sorted_set/unlock_queue.move
Adds queue_id to Unlocked events and populates it in earliest and latest processing.
Queue event assertions
collections/examples/sorted_set/tests/unlock_queue_tests.move
Verifies queue IDs and deadline ordering for emitted unlock events.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: kosedogus, bidzyyys, immrsd, 0xneshi

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning No pull request description was provided, so the required template sections and checklist are missing. Add the issue reference, a short change summary, and the Tests, Documentation, and Changelog checklist items.
Title check ❓ Inconclusive The title is related to the collection audit but too generic to identify the main code changes. Use a specific title naming the primary change, such as the zero-size order guard or event payload updates.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/collections-audit-N-05

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.68%. Comparing base (15eb9ac) to head (3b4fcdf).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #494   +/-   ##
=======================================
  Coverage   96.68%   96.68%           
=======================================
  Files          39       39           
  Lines        3895     3895           
  Branches      875      875           
=======================================
  Hits         3766     3766           
  Misses         74       74           
  Partials       55       55           
Flag Coverage Δ
contracts/access 65.46% <ø> (ø)
contracts/allowance 52.40% <ø> (ø)
contracts/finance 26.66% <ø> (ø)
contracts/sale 48.59% <ø> (ø)
contracts/timelock 54.32% <ø> (ø)
contracts/utils 44.09% <ø> (ø)
math/core 86.97% <ø> (ø)
math/fixed_point 63.37% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bidzyyys bidzyyys left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@ericnordelo
ericnordelo merged commit 7aa576f into main Jul 17, 2026
37 of 38 checks passed
@ericnordelo
ericnordelo deleted the fix/collections-audit-N-05 branch July 17, 2026 14:03
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.

2 participants