Skip to content

Commit 49a815b

Browse files
Merge pull request #36 from zancas/darkside_reloaded_2
guess that we want &self, and toss in implementations, could maybe be…
2 parents c8049a0 + 04ee632 commit 49a815b

File tree

6 files changed

+22
-11
lines changed

6 files changed

+22
-11
lines changed

darkside-tests/src/chain_generics.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub(crate) mod conduct_chain {
6161
elf
6262
}
6363

64-
fn lightserver_uri() -> Option<Uri> {
64+
fn lightserver_uri(&self) -> Option<http::Uri> {
6565
Some(self.client_builder.server_id.clone())
6666
}
6767

@@ -87,10 +87,11 @@ pub(crate) mod conduct_chain {
8787
}
8888

8989
async fn bump_chain(&mut self) {
90-
let height_before = zingolib::grpc_connector::get_latest_block(self.lightserver_uri())
91-
.await
92-
.unwrap()
93-
.height;
90+
let height_before =
91+
zingolib::grpc_connector::get_latest_block(self.lightserver_uri().unwrap())
92+
.await
93+
.unwrap()
94+
.height;
9495

9596
let blocks_to_add = 1;
9697

zingolib/src/lightclient/send.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ pub mod send_with_proposal {
238238
match crate::utils::conversion::txid_from_hex_encoded_str(
239239
serverz_txid_string.as_str(),
240240
) {
241-
Ok(reported_txid) => {
241+
Ok(_reported_txid) => {
242242
// happens during darkside tests
243243
// If this option is enabled, the LightClient will replace outgoing TxId records with the TxId picked by the server. necessary for darkside.
244244
// #[cfg(feature = "darkside_tests")]

zingolib/src/testutils/chain_generics/conduct_chain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub trait ConductChain {
1717
async fn setup() -> Self;
1818

1919
/// used to connect to server via grpc
20-
fn lightserver_uri() -> Option<Uri>;
20+
fn lightserver_uri(&self) -> Option<http::Uri>;
2121

2222
/// builds a faucet (funded from mining)
2323
async fn create_faucet(&mut self) -> LightClient;

zingolib/src/testutils/chain_generics/libtonode.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,8 @@ impl ConductChain for LibtonodeEnvironment {
6666
start_height + 1
6767
);
6868
}
69+
70+
fn lightserver_uri(&self) -> Option<http::Uri> {
71+
todo!()
72+
}
6973
}

zingolib/src/testutils/chain_generics/live_chain.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,8 @@ impl ConductChain for LiveChain {
2525
// average block time is 75 seconds. we do this twice here to insist on a new block
2626
tokio::time::sleep(std::time::Duration::from_secs(150)).await;
2727
}
28+
29+
fn lightserver_uri(&self) -> Option<http::Uri> {
30+
todo!()
31+
}
2832
}

zingolib/src/testutils/chain_generics/with_assertions.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,12 @@ where
7777
.expect("record is ok");
7878

7979
dbg!(
80-
crate::grpc_connector::get_latest_block(sender.config.lightwalletd_uri.read().unwrap())
81-
.await
82-
.unwrap()
83-
.height
80+
crate::grpc_connector::get_latest_block(
81+
sender.config.lightwalletd_uri.read().unwrap().to_owned()
82+
)
83+
.await
84+
.unwrap()
85+
.height
8486
);
8587

8688
lookup_statuses(sender, txids.clone()).await.map(|status| {

0 commit comments

Comments
 (0)