Skip to content

Replace traits by bitfield for ChannelVersion#1073

Merged
pm47 merged 2 commits intomasterfrom
channel-version-bitfield
Jul 15, 2019
Merged

Replace traits by bitfield for ChannelVersion#1073
pm47 merged 2 commits intomasterfrom
channel-version-bitfield

Conversation

@pm47
Copy link
Member

@pm47 pm47 commented Jul 12, 2019

It is better suited for composition of features.

This paves the way for #1026.

@pm47 pm47 requested a review from sstone July 12, 2019 16:25
@codecov-io
Copy link

codecov-io commented Jul 12, 2019

Codecov Report

Merging #1073 into master will increase coverage by 0.09%.
The diff coverage is 100%.

@@            Coverage Diff            @@
##           master   #1073      +/-   ##
=========================================
+ Coverage    82.5%   82.6%   +0.09%     
=========================================
  Files          99      99              
  Lines        7592    7595       +3     
  Branches      300     293       -7     
=========================================
+ Hits         6264    6274      +10     
+ Misses       1328    1321       -7
Impacted Files Coverage Δ
...in/scala/fr/acinq/eclair/api/JsonSerializers.scala 96.96% <ø> (ø) ⬆️
...ain/scala/fr/acinq/eclair/wire/ChannelCodecs.scala 100% <100%> (ø) ⬆️
...n/scala/fr/acinq/eclair/channel/ChannelTypes.scala 100% <100%> (ø) ⬆️
...c/main/scala/fr/acinq/eclair/channel/Channel.scala 83.97% <0%> (+0.09%) ⬆️
...src/main/scala/fr/acinq/eclair/router/Router.scala 86.76% <0%> (+0.94%) ⬆️
...cinq/eclair/blockchain/bitcoind/zmq/ZMQActor.scala 94.87% <0%> (+5.12%) ⬆️


sealed trait ChannelVersion
case class ChannelVersion(bits: BitVector) {
require(bits.size == 4 * 8, "channel version takes 4 bytes")
Copy link
Member

Choose a reason for hiding this comment

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

Size requirement is hardcoded in 3 different places, which not define it in ChannelVersion's companion object ?

@pm47 pm47 merged commit 00df431 into master Jul 15, 2019
@pm47 pm47 deleted the channel-version-bitfield branch July 15, 2019 11:11
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