@@ -12,7 +12,6 @@ use std::time::Duration;
12
12
13
13
use nostr:: prelude:: * ;
14
14
use nostr_database:: prelude:: * ;
15
- use nostr_relay_pool:: __private:: SharedState ;
16
15
use nostr_relay_pool:: prelude:: * ;
17
16
use tokio:: sync:: broadcast;
18
17
@@ -97,11 +96,6 @@ impl Client {
97
96
}
98
97
}
99
98
100
- #[ inline]
101
- fn state ( & self ) -> & SharedState {
102
- self . pool . state ( )
103
- }
104
-
105
99
/// Update minimum POW difficulty for received events
106
100
///
107
101
/// Events with a POW lower than the current value will be ignored to prevent resources exhaustion.
@@ -116,13 +110,13 @@ impl Client {
116
110
/// <https://github.com/nostr-protocol/nips/blob/master/42.md>
117
111
#[ inline]
118
112
pub fn automatic_authentication ( & self , enable : bool ) {
119
- self . state ( ) . automatic_authentication ( enable) ;
113
+ self . pool . state ( ) . automatic_authentication ( enable) ;
120
114
}
121
115
122
116
/// Check if signer is configured
123
117
#[ inline]
124
118
pub async fn has_signer ( & self ) -> bool {
125
- self . state ( ) . has_signer ( ) . await
119
+ self . pool . state ( ) . has_signer ( ) . await
126
120
}
127
121
128
122
/// Get current nostr signer
@@ -132,7 +126,7 @@ impl Client {
132
126
/// Returns an error if the signer isn't set.
133
127
#[ inline]
134
128
pub async fn signer ( & self ) -> Result < Arc < dyn NostrSigner > , Error > {
135
- Ok ( self . state ( ) . signer ( ) . await ?)
129
+ Ok ( self . pool . state ( ) . signer ( ) . await ?)
136
130
}
137
131
138
132
/// Set nostr signer
@@ -141,13 +135,13 @@ impl Client {
141
135
where
142
136
T : IntoNostrSigner ,
143
137
{
144
- self . state ( ) . set_signer ( signer) . await ;
138
+ self . pool . state ( ) . set_signer ( signer) . await ;
145
139
}
146
140
147
141
/// Unset nostr signer
148
142
#[ inline]
149
143
pub async fn unset_signer ( & self ) {
150
- self . state ( ) . unset_signer ( ) . await ;
144
+ self . pool . state ( ) . unset_signer ( ) . await ;
151
145
}
152
146
153
147
/// Get [`RelayPool`]
0 commit comments