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

Add public method to list pending monitor updates from ChainMonitor #1834

Conversation

dunxen
Copy link
Contributor

@dunxen dunxen commented Nov 7, 2022

Users have requested the feature to list pending monitor updates from ChainMonitor so this adds that.

Closes #1786

wpaulino
wpaulino previously approved these changes Nov 7, 2022
tnull
tnull previously approved these changes Nov 8, 2022
Copy link
Contributor

@valentinewallace valentinewallace left a comment

Choose a reason for hiding this comment

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

Feel free to squash!

@dunxen dunxen dismissed stale reviews from valentinewallace, tnull, and wpaulino via b98967d November 8, 2022 20:00
@dunxen dunxen force-pushed the 2022-11-expose-pending-monitor-updates branch from 28695e0 to b98967d Compare November 8, 2022 20:00
@codecov-commenter
Copy link

codecov-commenter commented Nov 8, 2022

Codecov Report

Base: 90.80% // Head: 90.75% // Decreases project coverage by -0.05% ⚠️

Coverage data is based on head (28695e0) compared to base (f1428fd).
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head 28695e0 differs from pull request most recent head 7f4ac0e. Consider uploading reports for the commit 7f4ac0e to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1834      +/-   ##
==========================================
- Coverage   90.80%   90.75%   -0.06%     
==========================================
  Files          89       87       -2     
  Lines       47963    47389     -574     
  Branches    47963    47389     -574     
==========================================
- Hits        43554    43008     -546     
+ Misses       4409     4381      -28     
Impacted Files Coverage Δ
lightning/src/chain/chainmonitor.rs 97.83% <100.00%> (+0.04%) ⬆️
lightning-invoice/src/utils.rs 94.43% <0.00%> (-0.77%) ⬇️
lightning-rapid-gossip-sync/src/processing.rs 91.48% <0.00%> (-0.53%) ⬇️
lightning-net-tokio/src/lib.rs 76.73% <0.00%> (-0.31%) ⬇️
lightning/src/routing/scoring.rs 96.61% <0.00%> (-0.29%) ⬇️
lightning/src/onion_message/blinded_route.rs 96.66% <0.00%> (-0.25%) ⬇️
lightning/src/chain/onchaintx.rs 95.01% <0.00%> (-0.22%) ⬇️
lightning/src/ln/channelmanager.rs 85.18% <0.00%> (-0.22%) ⬇️
lightning/src/util/ser.rs 91.66% <0.00%> (-0.14%) ⬇️
lightning/src/ln/payment_tests.rs 98.81% <0.00%> (-0.08%) ⬇️
... and 17 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@dunxen dunxen force-pushed the 2022-11-expose-pending-monitor-updates branch from b98967d to ed14819 Compare November 8, 2022 20:40
TheBlueMatt
TheBlueMatt previously approved these changes Nov 8, 2022
@TheBlueMatt
Copy link
Collaborator

error[E0277]: the type `[(chain::transaction::OutPoint, std::vec::Vec<MonitorUpdateId>)]` cannot be indexed by `&chain::transaction::OutPoint`
   --> lightning/src/chain/chainmonitor.rs:820:83
    |
820 |         assert!(nodes[1].chain_monitor.chain_monitor.list_pending_monitor_updates().get(funding_txo)
    |                                                                                     --- ^^^^^^^^^^^ slice indices are of type `usize` or ranges of `usize`
    |                                                                                     |
    |                                                                                     required by a bound introduced by this call
    |
    = help: the trait `SliceIndex<[(chain::transaction::OutPoint, std::vec::Vec<MonitorUpdateId>)]>` is not implemented for `&chain::transaction::OutPoint`
note: required by a bound in `core::slice::<impl [T]>::get`

error[E0277]: the type `[(chain::transaction::OutPoint, std::vec::Vec<MonitorUpdateId>)]` cannot be indexed by `&chain::transaction::OutPoint`
   --> lightning/src/chain/chainmonitor.rs:824:84
    |
824 |         assert!(!nodes[1].chain_monitor.chain_monitor.list_pending_monitor_updates().get(funding_txo)
    |                                                                                      --- ^^^^^^^^^^^ slice indices are of type `usize` or ranges of `usize`
    |                                                                                      |
    |                                                                                      required by a bound introduced by this call
    |
    = help: the trait `SliceIndex<[(chain::transaction::OutPoint, std::vec::Vec<MonitorUpdateId>)]>` is not implemented for `&chain::transaction::OutPoint`
note: required by a bound in `core::slice::<impl [T]>::get

Verified

This commit was signed with the committer’s verified signature.
dunxen dunxen
Users have requested the feature to list pending monitor updates from
`ChainMonitor` so this adds that.
@dunxen dunxen dismissed stale reviews from valentinewallace and TheBlueMatt via 7f4ac0e November 9, 2022 04:58
@dunxen dunxen force-pushed the 2022-11-expose-pending-monitor-updates branch from ed14819 to 7f4ac0e Compare November 9, 2022 04:58
@valentinewallace valentinewallace merged commit 30b9807 into lightningdevkit:main Nov 9, 2022
@dunxen dunxen deleted the 2022-11-expose-pending-monitor-updates branch November 9, 2022 17:44
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.

Expose list of pending monitor updates from ChainMonitor
6 participants