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

Improve CustomCommitmentsPlugin methods #1613

Merged
merged 5 commits into from
Dec 2, 2020
Merged

Improve CustomCommitmentsPlugin methods #1613

merged 5 commits into from
Dec 2, 2020

Conversation

akumaigorodski
Copy link
Contributor

This is a bunch of small changes to make CustomCommitmentsPlugin methods easier to works with.

@@ -329,9 +331,25 @@ object PostRestartHtlcCleaner {
private def isPendingUpstream(channelId: ByteVector32, htlcId: Long, htlcsIn: Seq[IncomingHtlc]): Boolean =
htlcsIn.exists(htlc => htlc.add.channelId == channelId && htlc.add.id == htlcId)

def groupByOrigin(htlcsOut: Seq[(Origin, ByteVector32, Long)], htlcsIn: Seq[IncomingHtlc]): Map[Origin, Set[ChannelIdAndHtlcId]] =
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This piece of code is non-trivial and reused in plugin so I've made it a separate method similar to PostRestartHtlcCleaner.decryptedIncomingHtlcs.

@codecov-io
Copy link

Codecov Report

Merging #1613 (e917ca9) into master (6b32fd0) will increase coverage by 0.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1613      +/-   ##
==========================================
+ Coverage   87.29%   87.36%   +0.06%     
==========================================
  Files         146      146              
  Lines       11061    11063       +2     
  Branches      466      474       +8     
==========================================
+ Hits         9656     9665       +9     
+ Misses       1405     1398       -7     
Impacted Files Coverage Δ
.../src/main/scala/fr/acinq/eclair/PluginParams.scala 0.00% <ø> (ø)
.../eclair/payment/relay/PostRestartHtlcCleaner.scala 90.62% <100.00%> (+0.11%) ⬆️
...cinq/eclair/blockchain/bitcoind/zmq/ZMQActor.scala 90.00% <0.00%> (-5.00%) ⬇️
...main/scala/fr/acinq/eclair/io/PeerConnection.scala 81.70% <0.00%> (-0.43%) ⬇️
...nq/eclair/blockchain/electrum/ElectrumWallet.scala 80.25% <0.00%> (-0.26%) ⬇️
...nq/eclair/blockchain/electrum/ElectrumClient.scala 73.52% <0.00%> (ø)
...c/main/scala/fr/acinq/eclair/channel/Channel.scala 86.06% <0.00%> (+0.08%) ⬆️
...main/scala/fr/acinq/eclair/router/Validation.scala 92.91% <0.00%> (+1.49%) ⬆️
...q/eclair/blockchain/electrum/ElectrumWatcher.scala 76.98% <0.00%> (+1.58%) ⬆️
...clair/blockchain/electrum/ElectrumClientPool.scala 82.79% <0.00%> (+4.30%) ⬆️

@t-bast t-bast merged commit ed61b57 into ACINQ:master Dec 2, 2020
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