Skip to content

[AT]: Support explicit record type when creating empty audit trails #222

@itsyaasir

Description

@itsyaasir

Feature description

Add explicit record type selection to audit trail creation so a trail can be created without an initial record while still preserving the fixed on-chain record payload type.

Motivation

Today the Rust SDK infers the trail record type from the initial record payload. That makes the initial record effectively required on the Rust side, even though the Move contract allows creating a trail with no initial record. An explicit record type would remove that mismatch and make empty-trail creation possible.

Requirements

  1. Allow callers to specify the trail record type explicitly during creation.
  2. Keep the initial record optional.
  3. If an initial record is provided, validate that its payload type matches the explicit record type.
  4. Preserve the current invariant that one trail has one fixed payload type for all records.
  5. Keep the Move and Rust APIs aligned for trail creation.

Open questions

Should the Rust API expose this as dedicated builders for text/bytes trails, a record type enum, or another typed creation helper?

Are you planning to do it yourself in a pull request?

Yes

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Product Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions