Skip to content

feat(export): add JSON fallback for snapshot export (#974)#1087

Open
Taofik01 wants to merge 1 commit intodotandev:mainfrom
Taofik01:feat/json-snapshot-export
Open

feat(export): add JSON fallback for snapshot export (#974)#1087
Taofik01 wants to merge 1 commit intodotandev:mainfrom
Taofik01:feat/json-snapshot-export

Conversation

@Taofik01
Copy link
Copy Markdown
Contributor

@Taofik01 Taofik01 commented Mar 28, 2026

Closes #974

What this PR does

Adds a JSON export option for StateSnapshot so users can export a specific
state frame to a human-readable file for manual auditing.

Changes

  • simulator/src/export.rs — new file with ExportFormat toggle (Json/Binary),
    export_snapshot(), to_json_pretty(), to_binary(), and load_snapshot()
  • simulator/src/lib.rs — registered pub mod export

How it works

  • ExportFormat::Json → pretty-printed JSON matching the Soroban RPC schema
  • ExportFormat::Binary → compact bincode encoding (existing internal format)
  • ExportFormat::from_flag("json") parses the new CLI internal flag
  • load_snapshot() auto-detects format from the file bytes

Acceptance criteria met

  • JSON export is human-readable and matches the Soroban RPC schema
  • CLI can output JSON snapshots via ExportFormat::from_flag()
  • Pretty-printing enabled via serde_json::to_string_pretty

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 28, 2026

@Taofik01 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

[TIME-TRAVEL] [FEAT] Implement JSON fallback for snapshot export

1 participant