Skip to content

Make tx_abort a variant of InteractiveTxMessageSend and refactor  #3406

Open
@dunxen

Description

@dunxen

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions