Skip to content

Fix build warnings #2374

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

Merged
merged 5 commits into from
Jun 27, 2023

Conversation

arik-so
Copy link
Contributor

@arik-so arik-so commented Jun 24, 2023

  • Fix warning about legacy deserialization prevention markers
  • Fix warning about public keys from hex
  • Fix warning about dummy HTLCSource type

@arik-so arik-so force-pushed the 2023-06-build-warning-fixes branch from efcec42 to 2ba7c4f Compare June 24, 2023 05:35
@codecov-commenter
Copy link

codecov-commenter commented Jun 24, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (d327c23) 90.32% compared to head (89aa7ac) 90.32%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2374   +/-   ##
=======================================
  Coverage   90.32%   90.32%           
=======================================
  Files         106      106           
  Lines       54948    54948           
  Branches    54948    54948           
=======================================
  Hits        49630    49630           
  Misses       5318     5318           
Impacted Files Coverage Δ
lightning/src/chain/package.rs 91.43% <ø> (ø)
lightning/src/ln/chan_utils.rs 94.51% <ø> (ø)
lightning/src/ln/channel.rs 89.42% <ø> (ø)
lightning/src/ln/channelmanager.rs 86.26% <ø> (ø)
lightning/src/ln/reload_tests.rs 95.81% <100.00%> (ø)
lightning/src/routing/router.rs 93.55% <100.00%> (ø)

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

@arik-so arik-so marked this pull request as ready for review June 24, 2023 14:14
@arik-so arik-so requested review from wpaulino and TheBlueMatt June 24, 2023 14:15
Copy link
Contributor

@wpaulino wpaulino left a comment

Choose a reason for hiding this comment

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

Thanks! Could we also fix these while we're at it?

warning: variable does not need to be mutable
   --> lightning/src/routing/router.rs:420:9
    |
420 |             for (mut path, blinded_tail_opt) in paths.iter_mut().zip(blinded_tails.into_iter()) {
    |                  ----^^^^
    |                  |
    |                  help: remove this `mut`
    |
    = note: `#[warn(unused_mut)]` on by default

warning: variable does not need to be mutable
    --> lightning/src/routing/router.rs:1224:8
     |
1224 |             let mut cur_hop = &mut self.hops.get_mut(i).unwrap().0;
     |                 ----^^^^^^^
     |                 |
     |                 help: remove this `mut`

warning: using `.clone()` on a double reference, which returns `&dyn BroadcasterInterface` instead of cloning the inner type
   --> lightning/src/ln/reload_tests.rs:387:108
    |
387 |     new_chain_monitor = test_utils::TestChainMonitor::new(Some(nodes[0].chain_source), nodes[0].tx_broadcaster.clone(), &logger, &fee_estimator, &persister, keys_manager);

@arik-so
Copy link
Contributor Author

arik-so commented Jun 24, 2023

Oh yeah, let's fix those other two. Interestingly, they actually did not show up last night in my build.

@arik-so
Copy link
Contributor Author

arik-so commented Jun 24, 2023

I'll think about how to fix the one in line 387.

@arik-so arik-so force-pushed the 2023-06-build-warning-fixes branch from 2ba7c4f to 8c982a3 Compare June 24, 2023 17:55
@arik-so
Copy link
Contributor Author

arik-so commented Jun 24, 2023

I'm not getting that warning about the clone. Which rust version are you using?

@TheBlueMatt
Copy link
Collaborator

cargo test --no-default-features --features _test_vectors no longer builds due to public_from_secret_hex not being found. While you're at it can you add a CI step to test that?

@TheBlueMatt
Copy link
Collaborator

Oops, nvm I'm blind

@TheBlueMatt TheBlueMatt merged commit 0f2c4c0 into lightningdevkit:main Jun 27, 2023
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.

4 participants