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

Make tx_abort a variant of InteractiveTxMessageSend and refactor #3406

Open
dunxen opened this issue Nov 13, 2024 · 0 comments
Open

Make tx_abort a variant of InteractiveTxMessageSend and refactor #3406

dunxen opened this issue Nov 13, 2024 · 0 comments

Comments

@dunxen
Copy link
Contributor

dunxen commented Nov 13, 2024

Shouldn't hold up this PR, but is there any reason why we don't simply add a TxAbort variant to InteractiveTxMessageSend? Then we wouldn't need either InteractiveTxMessageSendResult or HandleTxCompleteResult, IIUC, which would remove two layers of structs.

Otherwise, we go through the following conversions just to end up with a MessageSendEvent:

  • Result<InteractiveTxMessageSend, AbortReason>
  • InteractiveTxMessageSendResult(Result<InteractiveTxMessageSend, msgs::TxAbort>)
  • MessageSendEvent

The Results don't seem to buy us anything more than the extra variant would as we aren't doing anything special for the Err case. Then it would simply be:

  • InteractiveTxMessageSend
  • MessageSendEvent

And AFAICT, InteractiveTxConstructor has the channel_id, so there's no need to grab it from the ChannelContext. Or will it change in some case?

Originally posted by @jkczyz in #3137 (comment)

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