Skip to content

Commit dbf44f3

Browse files
G8XSUtnull
authored andcommitted
with arc
1 parent 36c60ac commit dbf44f3

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
@@ -338,7 +338,7 @@ impl NodeBuilder {
338338
/// previously configured.
339339
#[cfg(any(vss, vss_test))]
340340
pub fn build_with_vss_store(
341-
&self, url: String, store_id: String, auth_custom: impl AuthMethod + 'static,
341+
&self, url: String, store_id: String, auth_custom: Arc<dyn AuthMethod>,
342342
) -> Result<Node, BuildError> {
343343
let logger = setup_logger(&self.config)?;
344344

@@ -364,7 +364,7 @@ impl NodeBuilder {
364364

365365
let vss_seed_bytes: [u8; 32] = vss_xprv.private_key.secret_bytes();
366366

367-
let vss_store = Arc::new(VssStore::new(url, store_id, vss_seed_bytes, auth_custom));
367+
let vss_store = Arc::new(VssStore::new(url, store_id, vss_seed_bytes, auth_custom.clone()));
368368
build_with_store_internal(
369369
config,
370370
self.chain_data_source_config.as_ref(),
@@ -520,7 +520,7 @@ impl ArcedNodeBuilder {
520520
/// previously configured.
521521
#[cfg(any(vss, vss_test))]
522522
pub fn build_with_vss_store(
523-
&self, url: String, store_id: String, auth_custom: impl AuthMethod + 'static,
523+
&self, url: String, store_id: String, auth_custom: Arc<dyn AuthMethod>,
524524
) -> Result<Arc<Node>, BuildError> {
525525
self.inner.read().unwrap().build_with_vss_store(url, store_id).map(Arc::new)
526526
}

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)