fix(N-01): Missing Event Emission on State Change#159
fix(N-01): Missing Event Emission on State Change#1590xNeshi merged 26 commits intorelease-v1.0.0from
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
This pull request addresses issue #141 by adding missing event emissions for state-changing operations in the two-step transfer module. The changes enhance observability and auditability by ensuring all significant state changes emit corresponding events.
Changes:
- Added three new event structs:
OwnershipTransferRejected,ObjectWrapped, andObjectUnwrapped - Updated
wrap(),unwrap(), andreject()functions to emit events on state changes - Modified function signatures to accept
TxContextparameter where needed for event emission - Updated all test cases and helper functions to accommodate the new signatures
- Added test coverage for
ObjectWrappedandObjectUnwrappedevent emissions
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| contracts/access/sources/ownership_transfer/two_step.move | Added event structs for reject/wrap/unwrap operations, added event emissions in respective functions, updated function signatures to accept TxContext, added test helpers for new events |
| contracts/access/tests/two_step_tests.move | Updated all function calls to pass TxContext parameter, added comprehensive test for wrap/unwrap event emissions, renamed test function for clarity |
| contracts/access/Move.lock | Automatic lock file regeneration with updated Move toolchain version (v3 to v4) and dependency revisions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ericnordelo
left a comment
There was a problem hiding this comment.
Looking good @0xNeshi. Left a couple of comments.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* ref: naming and receiver syntax (#123) * Add test flag to test files (#122) * Add test flah to test files * Add #[test_only] tag in test modules --------- Co-authored-by: Daniel Bigos <daniel.bigos@icloud.com> * fix(H-01): reminder issue in div_rem (#151) * fix: reminder issue in div_rem * fix: docstring * ref: apply suggestions from code review Co-authored-by: immrsd <103599616+immrsd@users.noreply.github.com> * fix: fmt * ref: apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: immrsd <103599616+immrsd@users.noreply.github.com> * Remove explicit u256 type * feat: update CHANGELOG --------- Co-authored-by: Daniel Bigos <daniel.bigos@openzeppelin.com> Co-authored-by: immrsd <103599616+immrsd@users.noreply.github.com> Co-authored-by: Daniel Bigos <daniel.bigos@icloud.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: immrsd <immrsd.eth@gmail.com> * fix(N-01): Missing Event Emission on State Change (#159) * emit objectwrapped on wrap * emit objectunwrapped on unwrap * requester to owner * emit OwnershipTransferRejected on reject * call uid_to_inner on id directly * tests: fix * test: add ObjectUnwrapped assertions * test: include wrap flow in unwrap test * test: corrent event in reject_destroys_request * ref: remove Published.toml * feat: emit PendingTransferCancelled on cancel_schedule * fix: new event doc * feat: emit ObjectWrapped on delayed_transfer::wrap * ref: formatting * doc: fix comment above OwnershipTransferRejected * test: assert exact PendingTransferCancelled event data in cancel_allows_reschedule * ref: move ObjectWrapped to events section * test: add ObjectWrapped data assertion to wrap_emits_events * test: extract inlined code into local variable expected_event * ref: reorder objectwrapped events * feat: remove current_owner from OwnershipTransferRejected * test: ref wrap_emits_events * feat: remove ctx from two_step_transfer::reject * chore: update changelog * fix: rename ObjectWrapped->WrapExecuted & ObjectUnwrapped->UnwrapExecuted * fix: use &mut TxContext in two_step_transfer::unwrap (#169) * build: set explicit default prettier move values * build: gitignore .vscode * build: add comment about why vscode is ignored * test: rename test_new_object_wrapped->test_new_wrap_executed * test: rename test_new_object_unwrapped->test_new_unwrap_executed * build: add missing newline to .prettierrc * Revert "build: add missing newline to .prettierrc" This reverts commit 2f84812. * Revert "build: add comment about why vscode is ignored" This reverts commit 37948ab. * Revert "build: gitignore .vscode" This reverts commit c5e1c30. * Revert "build: set explicit default prettier move values" This reverts commit 1674a18. * fix: use &mut TxContext in unwrap * build: revert .prettierrc * chore: add missing changelog entry * build(ci): trigger CI jobs on release branches (#173) * build(ci): trigger CI jobs on release branches * fix: lint after N-01 fix * build(ci): update Sui version in CI jobs * fix: apply linter suggestions * ref: Update math/core/tests/macros_tests.move Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * ci: triggers no longer apply to v* branches (#176) * fix(L-01): inaccurate data emitted in events (#174) * fix(L-02): Emit Dedicated UnwrapExecuted Event on delayed > unwrap (#168) * feat: emit UnwrapExecuted on delayed > unwrap * test: rename test_new_object_wrapped->test_new_wrap_executed * Revert "test: rename test_new_object_wrapped->test_new_wrap_executed" This reverts commit 7b3129a. * chore: changelog * feat: add object_id to UnwrapExecuted * ref: revert change to prettierrc * fix: linter * chore: Move changelog entry to Breaking Changes * chore: Update CHANGELOG title name for breaking change Co-authored-by: Eric Nordelo <eric.nordelo39@gmail.com> * ref: invoke uid_to_inner as a method on struct --------- Co-authored-by: Daniel Bigos <daniel.bigos@openzeppelin.com> Co-authored-by: Daniel Bigos <daniel.bigos@icloud.com> Co-authored-by: Eric Nordelo <eric.nordelo39@gmail.com> * fix(N-08): unhandled overflow in safe_downcast_balance (#172) * fix(N-08): unhandled overflow in safe_downcast_balance * ref: apply suggestions from code review Co-authored-by: Nenad <nenad.misic@openzeppelin.com> --------- Co-authored-by: Nenad <nenad.misic@openzeppelin.com> * Fix N-09 audit issue (#161) Co-authored-by: Daniel Bigos <daniel.bigos@openzeppelin.com> * Remove unnecessary destroy_none call (#162) Co-authored-by: Daniel Bigos <daniel.bigos@openzeppelin.com> * fix(N-06): Incorrect Documentation (#187) * fix: doc comments * Update math/core/sources/u512.move Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix(N-03): code convention improvements (#163) * Fix function params order in delayed module * Fix error codes in two_step module * Support function params order changes in tests --------- Co-authored-by: Daniel Bigos <daniel.bigos@icloud.com> * docs(N-04): add missing docs + fix existing docs (#175) * docs: add missing docs + fix existing * docs: add missing doc update to u256::mul_div * build: revert prettier change * docs: align u16 module docs * docs: align all inv_mod docs * docs: remove term 'helper' for math functions * docs: align formatting in u16.move --------- Co-authored-by: Eric Nordelo <eric.nordelo39@gmail.com> Co-authored-by: Daniel Bigos <daniel.bigos@openzeppelin.com> * fix(N-05): Code and Documentation Inconsistencies (#188) * fix: doc comments consistency * feat: apply review suggestions * fix: coderabbit suggestions * feat: remove double empty lines * feat: update doc comment * ref: Two Step Transfer (and Delayed) improvements (#183) * feat: add main logic and doc entries * feat: update wording around caps * feat: use string literals * fix: typos * feat: apply review updates * feat: rename struct member * feat: use doc comment format for the library * feat: add ability constraints to pending request * feat: add security notes for shared object missue * feat: format files * feat: apply review updates --------- Co-authored-by: Daniel Bigos <daniel.bigos@icloud.com> * feat: add relase info * Add v1.0.0 release info (#210) * feat: add relase info * feat: apply review uppdates * feat: update version * feat: update SECURITY * docs: unify docs for math library (#212) * feat: update locks * feat: apply coderabbit suggestions --------- Co-authored-by: Bridgerz <bridgerzoske@gmail.com> Co-authored-by: Cove Marquis-Bortoli <44323490+CoveMB@users.noreply.github.com> Co-authored-by: Daniel Bigos <daniel.bigos@icloud.com> Co-authored-by: Daniel Bigos <daniel.bigos@openzeppelin.com> Co-authored-by: immrsd <103599616+immrsd@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: immrsd <immrsd.eth@gmail.com> Co-authored-by: Nenad <nenad.misic@openzeppelin.com>
* ref: naming and receiver syntax (#123) * Add test flag to test files (#122) * Add test flah to test files * Add #[test_only] tag in test modules --------- Co-authored-by: Daniel Bigos <daniel.bigos@icloud.com> * fix(H-01): reminder issue in div_rem (#151) * fix: reminder issue in div_rem * fix: docstring * ref: apply suggestions from code review Co-authored-by: immrsd <103599616+immrsd@users.noreply.github.com> * fix: fmt * ref: apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: immrsd <103599616+immrsd@users.noreply.github.com> * Remove explicit u256 type * feat: update CHANGELOG --------- Co-authored-by: Daniel Bigos <daniel.bigos@openzeppelin.com> Co-authored-by: immrsd <103599616+immrsd@users.noreply.github.com> Co-authored-by: Daniel Bigos <daniel.bigos@icloud.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: immrsd <immrsd.eth@gmail.com> * fix(N-01): Missing Event Emission on State Change (#159) * emit objectwrapped on wrap * emit objectunwrapped on unwrap * requester to owner * emit OwnershipTransferRejected on reject * call uid_to_inner on id directly * tests: fix * test: add ObjectUnwrapped assertions * test: include wrap flow in unwrap test * test: corrent event in reject_destroys_request * ref: remove Published.toml * feat: emit PendingTransferCancelled on cancel_schedule * fix: new event doc * feat: emit ObjectWrapped on delayed_transfer::wrap * ref: formatting * doc: fix comment above OwnershipTransferRejected * test: assert exact PendingTransferCancelled event data in cancel_allows_reschedule * ref: move ObjectWrapped to events section * test: add ObjectWrapped data assertion to wrap_emits_events * test: extract inlined code into local variable expected_event * ref: reorder objectwrapped events * feat: remove current_owner from OwnershipTransferRejected * test: ref wrap_emits_events * feat: remove ctx from two_step_transfer::reject * chore: update changelog * fix: rename ObjectWrapped->WrapExecuted & ObjectUnwrapped->UnwrapExecuted * fix: use &mut TxContext in two_step_transfer::unwrap (#169) * build: set explicit default prettier move values * build: gitignore .vscode * build: add comment about why vscode is ignored * test: rename test_new_object_wrapped->test_new_wrap_executed * test: rename test_new_object_unwrapped->test_new_unwrap_executed * build: add missing newline to .prettierrc * Revert "build: add missing newline to .prettierrc" This reverts commit 2f84812. * Revert "build: add comment about why vscode is ignored" This reverts commit 37948ab. * Revert "build: gitignore .vscode" This reverts commit c5e1c30. * Revert "build: set explicit default prettier move values" This reverts commit 1674a18. * fix: use &mut TxContext in unwrap * build: revert .prettierrc * chore: add missing changelog entry * build(ci): trigger CI jobs on release branches (#173) * build(ci): trigger CI jobs on release branches * fix: lint after N-01 fix * build(ci): update Sui version in CI jobs * fix: apply linter suggestions * ref: Update math/core/tests/macros_tests.move Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * ci: triggers no longer apply to v* branches (#176) * fix(L-01): inaccurate data emitted in events (#174) * fix(L-02): Emit Dedicated UnwrapExecuted Event on delayed > unwrap (#168) * feat: emit UnwrapExecuted on delayed > unwrap * test: rename test_new_object_wrapped->test_new_wrap_executed * Revert "test: rename test_new_object_wrapped->test_new_wrap_executed" This reverts commit 7b3129a. * chore: changelog * feat: add object_id to UnwrapExecuted * ref: revert change to prettierrc * fix: linter * chore: Move changelog entry to Breaking Changes * chore: Update CHANGELOG title name for breaking change Co-authored-by: Eric Nordelo <eric.nordelo39@gmail.com> * ref: invoke uid_to_inner as a method on struct --------- Co-authored-by: Daniel Bigos <daniel.bigos@openzeppelin.com> Co-authored-by: Daniel Bigos <daniel.bigos@icloud.com> Co-authored-by: Eric Nordelo <eric.nordelo39@gmail.com> * fix(N-08): unhandled overflow in safe_downcast_balance (#172) * fix(N-08): unhandled overflow in safe_downcast_balance * ref: apply suggestions from code review Co-authored-by: Nenad <nenad.misic@openzeppelin.com> --------- Co-authored-by: Nenad <nenad.misic@openzeppelin.com> * Fix N-09 audit issue (#161) Co-authored-by: Daniel Bigos <daniel.bigos@openzeppelin.com> * Remove unnecessary destroy_none call (#162) Co-authored-by: Daniel Bigos <daniel.bigos@openzeppelin.com> * fix(N-06): Incorrect Documentation (#187) * fix: doc comments * Update math/core/sources/u512.move Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix(N-03): code convention improvements (#163) * Fix function params order in delayed module * Fix error codes in two_step module * Support function params order changes in tests --------- Co-authored-by: Daniel Bigos <daniel.bigos@icloud.com> * docs(N-04): add missing docs + fix existing docs (#175) * docs: add missing docs + fix existing * docs: add missing doc update to u256::mul_div * build: revert prettier change * docs: align u16 module docs * docs: align all inv_mod docs * docs: remove term 'helper' for math functions * docs: align formatting in u16.move --------- Co-authored-by: Eric Nordelo <eric.nordelo39@gmail.com> Co-authored-by: Daniel Bigos <daniel.bigos@openzeppelin.com> * fix(N-05): Code and Documentation Inconsistencies (#188) * fix: doc comments consistency * feat: apply review suggestions * fix: coderabbit suggestions * feat: remove double empty lines * feat: update doc comment * ref: Two Step Transfer (and Delayed) improvements (#183) * feat: add main logic and doc entries * feat: update wording around caps * feat: use string literals * fix: typos * feat: apply review updates * feat: rename struct member * feat: use doc comment format for the library * feat: add ability constraints to pending request * feat: add security notes for shared object missue * feat: format files * feat: apply review updates --------- Co-authored-by: Daniel Bigos <daniel.bigos@icloud.com> * Add v1.0.0 release info (#210) * feat: add relase info * feat: apply review uppdates * feat: update version * feat: update SECURITY * Add target to delayed wrapping (#238) * feat: add relase info * feat: add target to wrapping * feat: update comment * feat: add another test * feat: add new reports * feat: add published info * feat: update CHANGELOG --------- Co-authored-by: Bridgerz <bridgerzoske@gmail.com> Co-authored-by: Cove Marquis-Bortoli <44323490+CoveMB@users.noreply.github.com> Co-authored-by: Daniel Bigos <daniel.bigos@icloud.com> Co-authored-by: Daniel Bigos <daniel.bigos@openzeppelin.com> Co-authored-by: immrsd <103599616+immrsd@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: immrsd <immrsd.eth@gmail.com> Co-authored-by: Nenad <nenad.misic@openzeppelin.com>
Resolves #141
PR Checklist