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

Reorganize internal codecs (master) #1732

Merged
merged 6 commits into from
Mar 19, 2021
Merged

Reorganize internal codecs (master) #1732

merged 6 commits into from
Mar 19, 2021

Conversation

pm47
Copy link
Member

@pm47 pm47 commented Mar 19, 2021

This PR is the same as #1731, but applied on master instead of on top of #1728.

The goal is to ensure maximum safety when migrating data.

To achieve this, we strictly segregate each codec version (to make sure
that we don't accidentally mix codec versions), while still letting
tests access each unitary codecs (which using inner private classes
would have prevented). Relevant tests only need to be moved to the
appropriate package.

The package structure is now:

wire
 |
 `-- internal
 |       |
 |       `-- channel
 |       |      |
 |       |      `-- version0
 |       |      |      |
 |       |      |      `-- ChannelCodecs0
 |       |      |
 |       |      `-- version1
 |       |      |      |
 |       |      |      `-- ChannelCodecs1
 |       |      |
 |       |      `-- ChannelCodecs
 |       |
 |       `-- CommandCodecs
 |
 `-- others

The goal is to ensure maximum safety when migrating data.

To achieve this, we strictly segregate each codec version (to make sure
that we don't accidentally mix codec versions), while still letting
tests access each unitary codecs (which using inner `private classes`
would have prevented). Relevant tests only need to be moved to the
appropriate package.

The package structure is now:

```
wire
 |
 `-- internal
 |       |
 |       `-- channel
 |       |      |
 |       |      `-- version0
 |       |      |      |
 |       |      |      `-- ChannelCodecs0
 |       |      |
 |       |      `-- version1
 |       |      |      |
 |       |      |      `-- ChannelCodecs1
 |       |      |
 |       |      `-- ChannelCodecs
 |       |
 |       `-- CommandCodecs
 |
 `-- others
```
@pm47 pm47 requested a review from t-bast March 19, 2021 10:05
@pm47 pm47 changed the title Reorganize internal codecs Reorganize internal codecs (master) Mar 19, 2021
Copy link
Member

@t-bast t-bast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@codecov-io
Copy link

Codecov Report

Merging #1732 (719b7fb) into master (8dc64db) will decrease coverage by 0.02%.
The diff coverage is 98.17%.

@@            Coverage Diff             @@
##           master    #1732      +/-   ##
==========================================
- Coverage   86.35%   86.33%   -0.03%     
==========================================
  Files         151      152       +1     
  Lines       11781    11784       +3     
  Branches      498      497       -1     
==========================================
  Hits        10174    10174              
- Misses       1607     1610       +3     
Impacted Files Coverage Δ
...ain/scala/fr/acinq/eclair/db/pg/PgChannelsDb.scala 95.94% <ø> (ø)
...scala/fr/acinq/eclair/db/pg/PgPendingRelayDb.scala 97.05% <ø> (ø)
...a/fr/acinq/eclair/db/sqlite/SqliteChannelsDb.scala 95.94% <ø> (ø)
.../acinq/eclair/db/sqlite/SqlitePendingRelayDb.scala 96.55% <ø> (ø)
.../fr/acinq/eclair/wire/internal/CommandCodecs.scala 100.00% <ø> (ø)
...ire/internal/channel/version0/ChannelCodecs0.scala 96.74% <96.74%> (ø)
...blockchain/electrum/db/sqlite/SqliteWalletDb.scala 84.70% <100.00%> (+0.18%) ⬆️
...main/scala/fr/acinq/eclair/wire/CommonCodecs.scala 96.42% <100.00%> (+0.06%) ⬆️
...q/eclair/wire/internal/channel/ChannelCodecs.scala 100.00% <100.00%> (ø)
...ire/internal/channel/version1/ChannelCodecs1.scala 100.00% <100.00%> (ø)
... and 5 more

@pm47 pm47 merged commit 4bc2dec into master Mar 19, 2021
@pm47 pm47 deleted the reorganize-codecs branch March 19, 2021 11:20
tompro pushed a commit to tompro/eclair that referenced this pull request Mar 21, 2021
The goal is to ensure maximum safety when migrating data.

To achieve this, we strictly segregate each codec version (to make sure
that we don't accidentally mix codec versions), while still letting
tests access each unitary codecs (which using inner `private classes`
would have prevented). Relevant tests only need to be moved to the
appropriate package.

The package structure is now:

```
wire
 |
 `-- internal
 |       |
 |       `-- channel
 |       |      |
 |       |      `-- version0
 |       |      |      |
 |       |      |      `-- ChannelCodecs0
 |       |      |
 |       |      `-- version1
 |       |      |      |
 |       |      |      `-- ChannelCodecs1
 |       |      |
 |       |      `-- ChannelCodecs
 |       |
 |       `-- CommandCodecs
 |
 `-- others
```

Co-authored-by: Bastien Teinturier <31281497+t-bast@users.noreply.github.com>
t-bast added a commit that referenced this pull request Mar 23, 2021
This is a follow-up for #1732

Codecs in the protocol package will always be backwards-compatible,
as they are defined in the spec.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants