Skip to content

Conversation

@itsyaasir
Copy link
Contributor

Description of change

This pull request refactors the handling of immutable metadata in the audit trail Move module, making the metadata optional and simplifying its structure. It is not ergonomic to have both fields as optional and can be simplified to follow better code conventions.

Audit trail metadata model changes:

  • Changed the TrailImmutableMetadata struct so that name is now a required String instead of an Option<String>, while description remains optional. (audit-trail-move/sources/audit_trail.move)
  • Made the immutable_metadata field of AuditTrail an Option<TrailImmutableMetadata> instead of a required value, allowing audit trails to be created without immutable metadata. (audit-trail-move/sources/audit_trail.move) [1] [2]
  • Updated the new_trail_metadata constructor to require a String for name and an Option<String> for description. (audit-trail-move/sources/audit_trail.move)

API and getter updates:

  • Refactored getter functions (trail_name and trail_description) to handle the optional nature of immutable_metadata, returning Option<String> as appropriate. (audit-trail-move/sources/audit_trail.move)

Links to any relevant issues

Type of change

  • Bug fix (a non-breaking change which fixes an issue)
  • Enhancement (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Fix

How the change has been tested

Change checklist

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that new and existing unit tests pass locally with my changes
  • I have updated the CHANGELOG.md, if my changes are significant enough

…ns to use non-optional name field; adjust tests for consistency
@itsyaasir itsyaasir self-assigned this Jan 14, 2026
@itsyaasir itsyaasir marked this pull request as ready for review January 14, 2026 08:49
@itsyaasir itsyaasir merged commit 622190b into feat/audit-trails-dev Jan 14, 2026
6 checks passed
@itsyaasir itsyaasir deleted the chore/make-immutable-md-optional branch January 14, 2026 19:10
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