Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tx edit. #1893

Merged
merged 13 commits into from
Mar 13, 2025
Merged

Add tx edit. #1893

merged 13 commits into from
Mar 13, 2025

Conversation

fnando
Copy link
Member

@fnando fnando commented Feb 26, 2025

What

Add tx edit, so users can edit a transaction envelope using JSON in a configured editor (it reads the STELLAR_EDITOR, EDITOR and VISUAL env vars).

tx-edit.mp4

Why

So users can have a more user friendly way of defining transactions.

Known limitations

There's no JSON autocompletion at the moment, but a future PR will add support for JSON schema's $schema in rs-stellar-xdr, which will make autocompletion work out of the box with editors like VSCode.

Support for JSON schema has been added directly to the CLI. Unfortunately, the JSON schema will be reported as invalid because rs-stellar-xdr does not add $schema as a valid key on each element that allowed in the transaction envelope. This is being tracked here: stellar/rs-stellar-xdr#417

@fnando fnando self-assigned this Feb 26, 2025
@fnando fnando added the enhancement New feature or request label Feb 26, 2025
@fnando fnando enabled auto-merge (squash) March 3, 2025 23:58
@fnando fnando force-pushed the tx-edit branch 2 times, most recently from 387e38f to d169f0a Compare March 4, 2025 21:15
@fnando fnando mentioned this pull request Mar 5, 2025
26 tasks
Copy link
Member Author

@fnando fnando left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add support for $schema (marked you on the comments). Other than that, I think this is good to go.

Copy link
Contributor

@elizabethengelman elizabethengelman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is looking awesome 👏

@fnando
Copy link
Member Author

fnando commented Mar 10, 2025

@leighmcculloch @Ifropc @elizabethengelman is this good to go?

Copy link
Contributor

@Ifropc Ifropc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On top of other comments:
I remember we were talking about recovering from user leaving editor with invalid transaction.
Do we still plan to do it in this PR?

I also think panic needs to be fixed before this can be merged

thread 'main' panicked at cmd/soroban-cli/src/commands/tx/edit.rs:171:75:
called `Result::unwrap()` on an `Err` value: Error("trailing characters", line: 2, column: 12)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

(On leaving editor with invalid JSON)

@Ifropc Ifropc self-requested a review March 11, 2025 20:51
@fnando fnando merged commit f558f0c into main Mar 13, 2025
31 checks passed
@fnando fnando deleted the tx-edit branch March 13, 2025 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants