-
Notifications
You must be signed in to change notification settings - Fork 86
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
feat: add tx set
#1760
base: main
Are you sure you want to change the base?
feat: add tx set
#1760
Conversation
Currently allows updating fields on Transactions V1 only.
/// Send a transaction envelope to the network | ||
Send(send::Cmd), | ||
/// Set various options for a transaction | ||
Set(set::Cmd), | ||
/// Simulate a transaction envelope from stdin | ||
Simulate(simulate::Cmd), | ||
/// Sign a transaction envelope appending the signature to the envelope | ||
Sign(sign::Cmd), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we organise these commands by order of likely to use next? i.e.:
- New
- Set
- Simulate
- Sign
- Send
XdrStdin(#[from] super::xdr::Error), | ||
#[error(transparent)] | ||
Xdr(#[from] xdr::Error), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are there two distinct xdr error types in use here? There should only ever be one in the cli in use.
FULL_HELP_DOCS.md
Outdated
## `stellar tx set` | ||
|
||
Set various options for a transaction | ||
|
||
**Usage:** `stellar tx set [OPTIONS]` | ||
|
||
###### **Options:** | ||
|
||
* `--sequence-number <SEQUENCE_NUMBER>` — Set the transactions sequence number | ||
* `--fee <FEE>` — Set the transactions fee | ||
* `--memo-text <MEMO_TEXT>` — Set the transactions memo text | ||
* `--memo-id <MEMO_ID>` — Set the transactions memo id | ||
* `--memo-hash <MEMO_HASH>` — Set the transactions memo hash | ||
* `--memo-return <MEMO_RETURN>` — Set the transactions memo return | ||
* `--source-account <SOURCE_ACCOUNT>` — Change the source account for the transaction | ||
* `--max-time-bound <MAX_TIME_BOUND>` — Set the transactions max time bound | ||
* `--min-time-bound <MIN_TIME_BOUND>` — Set the transactions min time bound | ||
* `--min-ledger <MIN_LEDGER>` — Set the minimum ledger that the transaction is valid | ||
* `--max-ledger <MAX_LEDGER>` — Set the max ledger that the transaction is valid. 0 or not present means to max | ||
* `--min-seq-num <MIN_SEQ_NUM>` — set mimimum sequence number | ||
* `--min-seq-age <MIN_SEQ_AGE>` | ||
* `--min-seq-ledger-gap <MIN_SEQ_LEDGER_GAP>` — min sequeence ledger gap | ||
* `--extra-signers <EXTRA_SIGNERS>` — Extra signers | ||
* `--no-preconditions` — Set precondition to None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Playing around with this interface I think some design discussion is required for this sub-command.
When we previously discussed this (#1643 (comment)) I had suggested we could have one sub-command per field to set, but I think this arrangement is also reasonable, but looks like there's missing functionality as it is, so we need that design to flesh out all the use cases.
For example, it looks like we can clear all the preconditions with 'no-preconditions', but it's not obvious to a user which fields are being cleared because the options are bundled in a single command the relationship between all the options appear equal / related, when they are not.
Another example, there's no way to remove a memo, or some precondition fields without clearing all preconditions.
I've started a design discussion on the issue:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leighmcculloch I've pushed up some changes that I think align with the updated design discussion from #1643 - is this in line with what you had in mind? I have some ideas for refactoring things to DRY them up, but wanted to get some feedback on the UI before I cleaned up.
This pull request is stale because it has been open for 30 days with no activity. It will be closed in 30 days unless the stale label is removed. |
This pull request is stale because it has been open for 30 days with no activity. It will be closed in 90 days unless the stale label is removed. |
376b50a
to
57a3e11
Compare
e76e014
to
93bcd8f
Compare
@@ -1517,6 +1517,8 @@ Sign, Simulate, and Send transactions | |||
|
|||
* `hash` — Calculate the hash of a transaction envelope | |||
* `new` — Create a new transaction | |||
* `edit` — | |||
* `set` — Set various options for a transaction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
planning to remove this command once the transition to being nested under edit
is complete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm currently using tx edit
to do interactive editing on #1893, but we can discuss how we can make both of our ideas work together (I'll add this as discussion topic for today).
It'd be nice if prs were scoped by the actual feature you're working on, in this case tx set
. Can you please keep a separate branch with your tx edit
version in draft mode, and only put the tx set
changes up for review?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm currently using tx edit to do interactive editing on #1893, but we can discuss how we can make both of our ideas work together (I'll add this as discussion topic for today).
Sounds great!
It'd be nice if prs were scoped by the actual feature you're working on, in this case tx set. Can you please keep a separate branch with your tx edit version in draft mode, and only put the tx set changes up for review?
I agree—based on the discussion in #1643, it sounded like there was interest in moving tx set
under tx edit
rather than keeping it as a separate command. With that in mind, I was viewing this PR as implementing tx edit set
.
This PR should definitely still be in draft—nice catch! Would it make sense to close this one and start a new PR for clarity? Happy to discuss further in the meeting later as well!
d3a8578
to
f5ef919
Compare
f5ef919
to
5ce14d3
Compare
Currently allows updating fields on Transactions V1 only.
Close #1643