Skip to content

Commit a83b58e

Browse files
G8XSUtnull
authored andcommitted
with arc
1 parent ca05de4 commit a83b58e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/builder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ impl NodeBuilder {
295295
/// previously configured.
296296
#[cfg(any(vss, vss_test))]
297297
pub fn build_with_vss_store(
298-
&self, url: String, store_id: String, auth_custom: impl AuthMethod + 'static,
298+
&self, url: String, store_id: String, auth_custom: Arc<dyn AuthMethod>,
299299
) -> Result<Node, BuildError> {
300300
let logger = setup_logger(&self.config)?;
301301

@@ -321,7 +321,7 @@ impl NodeBuilder {
321321

322322
let vss_seed_bytes: [u8; 32] = vss_xprv.private_key.secret_bytes();
323323

324-
let vss_store = Arc::new(VssStore::new(url, store_id, vss_seed_bytes, auth_custom));
324+
let vss_store = Arc::new(VssStore::new(url, store_id, vss_seed_bytes, auth_custom.clone()));
325325
build_with_store_internal(
326326
config,
327327
self.chain_data_source_config.as_ref(),
@@ -462,7 +462,7 @@ impl ArcedNodeBuilder {
462462
/// previously configured.
463463
#[cfg(any(vss, vss_test))]
464464
pub fn build_with_vss_store(
465-
&self, url: String, store_id: String, auth_custom: impl AuthMethod + 'static,
465+
&self, url: String, store_id: String, auth_custom: Arc<dyn AuthMethod>,
466466
) -> Result<Arc<Node>, BuildError> {
467467
self.inner.read().unwrap().build_with_vss_store(url, store_id).map(Arc::new)
468468
}

src/io/vss_store.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub struct VssStore {
4242
impl VssStore {
4343
pub(crate) fn new(
4444
base_url: String, store_id: String, data_encryption_key: [u8; 32],
45-
auth_custom: impl AuthMethod + 'static,
45+
auth_custom: Arc<dyn AuthMethod>,
4646
) -> Self {
4747
let runtime = tokio::runtime::Builder::new_multi_thread().enable_all().build().unwrap();
4848
let storable_builder = StorableBuilder::new(data_encryption_key, RandEntropySource);
@@ -60,7 +60,7 @@ impl VssStore {
6060
}) as _);
6161

6262
let client = VssClient::new(&base_url, retry_policy);
63-
Self { client, store_id, runtime, storable_builder, auth_custom: Arc::new(auth_custom) }
63+
Self { client, store_id, runtime, storable_builder, auth_custom }
6464
}
6565

6666
fn build_key(

0 commit comments

Comments
 (0)