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

Introduce OffersMessageFlow #3412

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Commits on Nov 18, 2024

  1. Introduce message_received in Offer/OnionMessageHandler

    To decouple offers and onion message-related code from `ChannelManager`,
    this commit introduces the `message_received` function in `Offer/OnionMessageHandler`.
    
    Currently, the function focuses on handling the retry logic for `InvoiceRequest`
    messages. Moving this responsibility ensures a cleaner separation of concerns
    and sets the foundation for managing offers/onion messages directly within the
    appropriate handler.
    shaavan committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    9e47005 View commit details
    Browse the repository at this point in the history
  2. Move message_received out of ChannelMessageHandler

    Since `ChannelMessageHandler`'s `message_received` function was solely
    used for handling invoice request retries. This function has been
    removed from `ChannelMessageHandler`, and the relevant code has been
    migrated to `OffersMessageHandler`'s `message_received`.
    
    This ensures invoice request retries are now handled in the appropriate context.
    shaavan committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    d36e297 View commit details
    Browse the repository at this point in the history
  3. Introduce OffersMessageFlow

    This commit introduces a new struct, `OffersMessageFlow`,
    to extract all offers message-related code out of `ChannelManager`.
    
    By moving this logic into a dedicated struct, it creates
    a foundation for separating responsibilities and sets up
    a base for further code restructuring in subsequent commits.
    shaavan committed Nov 18, 2024
    Configuration menu
    Copy the full SHA
    9825101 View commit details
    Browse the repository at this point in the history

Commits on Nov 19, 2024

  1. Introduce OffersMessageCommons Trait and Implementation

    A new trait, `OffersMessageCommons`, is introduced to encapsulate
    functions that are commonly used by both BOLT12-related functionality
    and other parts of `ChannelManager`.
    
    This enables a clean transition of BOLT12 code to `OffersMessageFlow`
    by moving shared functions into the new trait, ensuring they remain
    accessible to both `ChannelManager` and the refactored BOLT12 code.
    shaavan committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    9bd8f9c View commit details
    Browse the repository at this point in the history
  2. Refactor OffersMessageHandler Implementation to OffersMessageFlow

    This commit introduces the `OffersMessageHandler` implementation
    for `OffersMessageFlow`, enabling direct access to offer-specific
    functionality through `OffersMessageFlow`.
    
    In subsequent commits, all other implementations of `OffersMessageHandler`
    will be removed, consolidating `OffersMessageHandler` as the single
    source of its implementation.
    shaavan committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    57e8ccc View commit details
    Browse the repository at this point in the history
  3. Update Test Framework

    This commit introduces `OffersMessageFlow` in `functional_test`,
    transitioning the source of `OffersMessageHandler` implementation
    to `OffersMessageFlow`.
    
    With this change, the `ChannelManager`'s implementation becomes
    redundant and will be removed in the next commit.
    shaavan committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    ac95bc0 View commit details
    Browse the repository at this point in the history
  4. Remove OffersMessageHandler Implementation for ChannelManager

    With `OffersMessageFlow` now serving as the source of `OffersMessageHandler`
    implementation, the implementation in `ChannelManager` is no longer needed
    and has been safely removed.
    shaavan committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    fde5b13 View commit details
    Browse the repository at this point in the history
  5. Introduce AnOffersMessageFlow

    - This commit introduces a new struct, `AnOffersMessageFlow`,
      which generically implements `OffersMessageFlow`.
    - In subsequent commits, this struct will be utilized for
      documentation purposes.
    shaavan committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    baee2d5 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    9705a65 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    58b9fd2 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    a59b356 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    e038951 View commit details
    Browse the repository at this point in the history