Skip to content

Commit

Permalink
to String
Browse files Browse the repository at this point in the history
  • Loading branch information
G8XSU committed Jan 7, 2024
1 parent f87d3e7 commit 5aa2f45
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ impl NodeBuilder {
/// previously configured.
#[cfg(any(vss, vss_test))]
pub fn build_with_vss_store(
&self, url: &str, store_id: String,
&self, url: String, store_id: String,
) -> Result<Node<VssStore>, BuildError> {
let logger = setup_logger(&self.config)?;

Expand Down
6 changes: 3 additions & 3 deletions src/io/vss_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ pub struct VssStore {
}

impl VssStore {
pub(crate) fn new(base_url: &str, store_id: String, data_encryption_key: [u8; 32]) -> Self {
let client = VssClient::new(base_url);
pub(crate) fn new(base_url: String, store_id: String, data_encryption_key: [u8; 32]) -> Self {
let client = VssClient::new(base_url.as_str());
let runtime = tokio::runtime::Builder::new_multi_thread().enable_all().build().unwrap();
let storable_builder = StorableBuilder::new(data_encryption_key, RandEntropySource);
Self { client, store_id, runtime, storable_builder }
Expand Down Expand Up @@ -209,7 +209,7 @@ mod tests {
let rand_store_id: String = (0..7).map(|_| rng.sample(Alphanumeric) as char).collect();
let mut data_encryption_key = [0u8; 32];
rng.fill_bytes(&mut data_encryption_key);
let vss_store = VssStore::new(&vss_base_url, rand_store_id, data_encryption_key);
let vss_store = VssStore::new(vss_base_url, rand_store_id, data_encryption_key);

do_read_write_remove_list_persist(&vss_store);
}
Expand Down
5 changes: 3 additions & 2 deletions tests/integration_tests_vss.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ fn channel_full_cycle_with_vss_store() {
let mut builder_a = Builder::from_config(config_a);
builder_a.set_esplora_server(esplora_url.clone());
let vss_base_url = std::env::var("TEST_VSS_BASE_URL").unwrap();
let node_a = builder_a.build_with_vss_store(&vss_base_url, "node_1_store".to_string()).unwrap();
let node_a =
builder_a.build_with_vss_store(vss_base_url.clone(), "node_1_store".to_string()).unwrap();
node_a.start().unwrap();

println!("\n== Node B ==");
let config_b = common::random_config();
let mut builder_b = Builder::from_config(config_b);
builder_b.set_esplora_server(esplora_url);
let node_b = builder_b.build_with_vss_store(&vss_base_url, "node_2_store".to_string()).unwrap();
let node_b = builder_b.build_with_vss_store(vss_base_url, "node_2_store".to_string()).unwrap();
node_b.start().unwrap();

common::do_channel_full_cycle(node_a, node_b, &bitcoind.client, &electrsd.client, false);
Expand Down

0 comments on commit 5aa2f45

Please sign in to comment.