@@ -47,23 +47,35 @@ use core::ops::Deref;
47
47
use core:: sync:: atomic:: { AtomicUsize , Ordering } ;
48
48
use bitcoin:: secp256k1:: PublicKey ;
49
49
50
- #[ derive( Debug , Clone , Copy , Hash , PartialEq , Eq ) ]
51
- /// A specific update's ID stored in a `MonitorUpdateId`, separated out to make the contents
52
- /// entirely opaque.
53
- enum UpdateOrigin {
54
- /// An update that was generated by the `ChannelManager` (via our `chain::Watch`
55
- /// implementation). This corresponds to an actual [`ChannelMonitorUpdate::update_id`] field
56
- /// and [`ChannelMonitor::get_latest_update_id`].
57
- OffChain ( u64 ) ,
58
- /// An update that was generated during blockchain processing. The ID here is specific to the
59
- /// generating [`ChainMonitor`] and does *not* correspond to any on-disk IDs.
60
- ChainSync ( u64 ) ,
50
+ mod update_origin {
51
+ #[ derive( Debug , Clone , Copy , Hash , PartialEq , Eq ) ]
52
+ /// A specific update's ID stored in a `MonitorUpdateId`, separated out to make the contents
53
+ /// entirely opaque.
54
+ pub ( crate ) enum UpdateOrigin {
55
+ /// An update that was generated by the `ChannelManager` (via our `chain::Watch`
56
+ /// implementation). This corresponds to an actual [`[ChannelMonitorUpdate]::update_id`] field
57
+ /// and [`[ChannelMonitor]::get_latest_update_id`].
58
+ ///
59
+ /// [ChannelMonitor]: crate::chain::channelmonitor::ChannelMonitor
60
+ /// [ChannelMonitorUpdate]: crate::chain::channelmonitor::ChannelMonitorUpdate
61
+ OffChain ( u64 ) ,
62
+ /// An update that was generated during blockchain processing. The ID here is specific to the
63
+ /// generating [ChannelMonitor] and does *not* correspond to any on-disk IDs.
64
+ ///
65
+ /// [ChannelMonitor]: crate::chain::channelmonitor::ChannelMonitor
66
+ ChainSync ( u64 ) ,
67
+ }
61
68
}
62
69
70
+ #[ cfg( any( feature = "_test_utils" , test) ) ]
71
+ pub ( crate ) use update_origin:: UpdateOrigin ;
72
+ #[ cfg( not( any( feature = "_test_utils" , test) ) ) ]
73
+ use update_origin:: UpdateOrigin ;
74
+
63
75
/// An opaque identifier describing a specific [`Persist`] method call.
64
76
#[ derive( Debug , Clone , Copy , Hash , PartialEq , Eq ) ]
65
77
pub struct MonitorUpdateId {
66
- contents : UpdateOrigin ,
78
+ pub ( crate ) contents : UpdateOrigin ,
67
79
}
68
80
69
81
impl MonitorUpdateId {
0 commit comments