Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

guess that we want &self, and toss in implementations, could maybe be… #36

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions darkside-tests/src/chain_generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub(crate) mod conduct_chain {
elf
}

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

Expand All @@ -87,10 +87,11 @@ pub(crate) mod conduct_chain {
}

async fn bump_chain(&mut self) {
let height_before = zingolib::grpc_connector::get_latest_block(self.lightserver_uri())
.await
.unwrap()
.height;
let height_before =
zingolib::grpc_connector::get_latest_block(self.lightserver_uri().unwrap())
.await
.unwrap()
.height;

let blocks_to_add = 1;

Expand Down
2 changes: 1 addition & 1 deletion zingolib/src/lightclient/send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ pub mod send_with_proposal {
match crate::utils::conversion::txid_from_hex_encoded_str(
serverz_txid_string.as_str(),
) {
Ok(reported_txid) => {
Ok(_reported_txid) => {
// happens during darkside tests
// If this option is enabled, the LightClient will replace outgoing TxId records with the TxId picked by the server. necessary for darkside.
// #[cfg(feature = "darkside_tests")]
Expand Down
2 changes: 1 addition & 1 deletion zingolib/src/testutils/chain_generics/conduct_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub trait ConductChain {
async fn setup() -> Self;

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

/// builds a faucet (funded from mining)
async fn create_faucet(&mut self) -> LightClient;
Expand Down
4 changes: 4 additions & 0 deletions zingolib/src/testutils/chain_generics/libtonode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,8 @@ impl ConductChain for LibtonodeEnvironment {
start_height + 1
);
}

fn lightserver_uri(&self) -> Option<http::Uri> {
todo!()
}
}
4 changes: 4 additions & 0 deletions zingolib/src/testutils/chain_generics/live_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@ impl ConductChain for LiveChain {
// average block time is 75 seconds. we do this twice here to insist on a new block
tokio::time::sleep(std::time::Duration::from_secs(150)).await;
}

fn lightserver_uri(&self) -> Option<http::Uri> {
todo!()
}
}
10 changes: 6 additions & 4 deletions zingolib/src/testutils/chain_generics/with_assertions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,12 @@ where
.expect("record is ok");

dbg!(
crate::grpc_connector::get_latest_block(sender.config.lightwalletd_uri.read().unwrap())
.await
.unwrap()
.height
crate::grpc_connector::get_latest_block(
sender.config.lightwalletd_uri.read().unwrap().to_owned()
)
.await
.unwrap()
.height
);

lookup_statuses(sender, txids.clone()).await.map(|status| {
Expand Down
Loading