]> git.bitcoin.ninja Git - rust-lightning/commit
Increase poll::Validate visibility to pub
authorJeffrey Czyz <jkczyz@gmail.com>
Thu, 17 Jun 2021 18:40:52 +0000 (13:40 -0500)
committerJeffrey Czyz <jkczyz@gmail.com>
Fri, 18 Jun 2021 05:26:33 +0000 (00:26 -0500)
commit8cc026b4068e72ecb6d3e0d22a4ace266d59576d
tree118da30abaf9d972c00b96c6e90200bd1e1e7d68
parent294009969aef617df4184ff41ef6daa5a445f213
Increase poll::Validate visibility to pub

Previously, poll::Validate was pub(crate) to force external implementors
of Poll to define their implementation in terms of ChainPoller. This was
because ChainPoller::look_up_previous_header checks for consistency
between headers and any errors would be checked at that level rather
than by the caller. Otherwise, if performed by the caller, a Poll
implementation would not be aware if the underlying BlockSource was
providing bad data and therefore couldn't react accordingly.

Widening the visibility to pub relaxes this requirement, although it's
still encourage to use ChainPoller to implement Poll. This permits
either copying or moving lightning-block-sync's test utilities to a
separate crate since they use poll::Validate.
lightning-block-sync/src/poll.rs