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

Refactor Transaction type to better reflect its true usage #2519

Open
ckniffen opened this issue Oct 13, 2023 · 0 comments
Open

Refactor Transaction type to better reflect its true usage #2519

ckniffen opened this issue Oct 13, 2023 · 0 comments

Comments

@ckniffen
Copy link
Collaborator

Before #2515 pseudo transactions were not typed to be returned by tx or ledger commands. The type used by those was Transaction. In order to not be a breaking change a new type of PseudoTransaction was added and Transaction | PseudoTransaction was used everywhere Transaction was used but a PseudoTransaction always could have come back.

A cleaner implementation would be to create a new type of SubmittableTransaction which equals the current value of Transaction. Transaction would then be updated to equal SubmittableTransaction | PseudoTransaction. The SubmittableTransaction can be used with client.submit.

Related to #2515 (comment) and #2515 (review)

ckniffen added a commit that referenced this issue Oct 23, 2023
BREAKING CHANGE: `Transaction` type has been redefined to include all
transactions and `SubmittableTransaction` was created to define the old
value. The following functions which only handle transactions to be
submitted now use `SubmittableTransaction`:
  * `Client.autofill`
  * `Client.submit`
  * `Client.submitAndWait`
  * `Client.prepareTransaction`
  * `getSignedTx`
  * `isAccountDelete`

Closes #2519
ckniffen added a commit that referenced this issue Oct 25, 2023
BREAKING CHANGE: `Transaction` type has been redefined to include all
transactions and `SubmittableTransaction` was created to define the old
value. The following functions which only handle transactions to be
submitted now use `SubmittableTransaction`:
  * `Client.autofill`
  * `Client.submit`
  * `Client.submitAndWait`
  * `Client.prepareTransaction`
  * `getSignedTx`
  * `isAccountDelete`

Closes #2519
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant