-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Feature description
Introduce a flexible Data payload type for audit trails so one trail can store both text and binary record data.
The intended model is to support an enum-like payload shape equivalent to:
enum Data has store + copy + drop {
Bytes(vector<u8>),
Text(String),
}This would allow using AuditTrail<Data> as the default flexible trail shape, while still leaving room for custom payload types where needed.
Motivation
Today an audit trail is generic over one fixed data type. Once a trail is created as AuditTrail<String> or AuditTrail<vector<u8>>, that choice is permanent for all records in that trail.
That makes the trail schema rigid for users who want a mix of text and binary records. The discussed conclusion was that a flexible Data enum would provide a better default experience for Rust and TS users while preserving the generic model for custom Move payload types.
Requirements
- Introduce a Move payload type equivalent to
Data { Bytes(vector<u8>), Text(String) }. - Allow
AuditTrail<Data>to be used as the flexible/default trail payload type. - Preserve support for custom generic payload types, e.g.
AuditTrail<MyCustomDataType>. - Expose the same flexible
Datamodel consistently in Rust and TS. - Keep record add/read APIs aligned across Move, Rust, and TS.
Open questions
Should AuditTrail<Data> become the primary/default path in the SDKs while still allowing advanced users to opt into custom generic payload types?
Are you planning to do it yourself in a pull request?
Yes
Metadata
Metadata
Assignees
Labels
Type
Projects
Status