Skip to content
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
39 changes: 21 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ members = [
"sequencer-sqlite",
"slow-tests",
"staking-cli",
"test-utils",
"tests",
"types",
"utils",
Expand Down Expand Up @@ -83,6 +84,7 @@ default-members = [
"sequencer",
"slow-tests",
"staking-cli",
"test-utils",
"tests",
"types",
"utils",
Expand Down Expand Up @@ -194,6 +196,7 @@ hotshot-utils = { path = "crates/hotshot/utils" }

espresso-types = { path = "types" }
light-client = { path = "light-client" }
test-utils = { path = "test-utils" }

# VID import
vid = { path = "vid", features = ["parallel", "keccak256"] }
Expand Down Expand Up @@ -248,7 +251,6 @@ log-panics = { version = "2.0", features = ["with-backtrace"] }
lru = "0.12"
num-traits = "0.2"
paste = "1.0"
portpicker = "0.1.1"
pretty_assertions = { version = "1.4", features = ["unstable"] }
priority-queue = "2"
rand = "0.8.5"
Expand Down
2 changes: 1 addition & 1 deletion crates/builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ hotshot-events-service = { workspace = true }
hotshot-example-types = { workspace = true }
hotshot-state-prover = { workspace = true }
hotshot-types = { workspace = true }
portpicker = { workspace = true }
rand = { workspace = true }
sequencer = { path = "../../sequencer", default-features = false }
sequencer-utils = { path = "../../utils" }
surf-disco = { workspace = true }
test-utils = { workspace = true }
tide-disco = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }
Expand Down
21 changes: 2 additions & 19 deletions crates/builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ pub mod testing {
use super::*;
use crate::non_permissioned::BuilderConfig;

#[derive(Clone)]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will add this back

pub struct HotShotTestConfig {
pub config: HotShotConfig<SeqTypes>,
priv_keys_staking_nodes: Vec<BLSPrivKey>,
Expand Down Expand Up @@ -239,18 +238,6 @@ pub mod testing {
}
}

// url for the hotshot event streaming api
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be unused, hence removed.

pub fn hotshot_event_streaming_api_url() -> Url {
// spawn the event streaming api
let port = portpicker::pick_unused_port()
.expect("Could not find an open port for hotshot event streaming api");

let hotshot_events_streaming_api_url =
Url::parse(format!("http://localhost:{port}").as_str()).unwrap();

hotshot_events_streaming_api_url
}

// start the server for the hotshot event streaming api
pub fn run_hotshot_event_streaming_api(
url: Url,
Expand Down Expand Up @@ -405,13 +392,9 @@ pub mod testing {

pub fn hotshot_builder_url() -> Url {
// spawn the builder api
let port =
portpicker::pick_unused_port().expect("Could not find an open port for builder api");

let hotshot_builder_api_url =
Url::parse(format!("http://localhost:{port}").as_str()).unwrap();
let port = test_utils::reserve_tcp_port().expect("Failed to bind TCP port for builder api");

hotshot_builder_api_url
Url::parse(format!("http://localhost:{port}").as_str()).unwrap()
}

pub async fn test_builder_impl(
Expand Down
5 changes: 2 additions & 3 deletions crates/builder/src/non_permissioned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ impl BuilderConfig {
mod test {
use espresso_types::MockSequencerVersions;
use futures::StreamExt;
use portpicker::pick_unused_port;
use sequencer::{
api::{
options::HotshotEvents,
Expand All @@ -267,11 +266,11 @@ mod test {
/// Builder subscrived to this api, and server the hotshot client request and the private mempool tx submission
#[test_log::test(tokio::test(flavor = "multi_thread"))]
async fn test_non_permissioned_builder() {
let query_port = pick_unused_port().expect("No ports free");
let query_port = test_utils::reserve_tcp_port().expect("Failed to bind port");

let event_service_url: Url = format!("http://localhost:{query_port}").parse().unwrap();

let builder_port = pick_unused_port().expect("No ports free");
let builder_port = test_utils::reserve_tcp_port().expect("Failed to bind port");
let builder_api_url: Url = format!("http://localhost:{builder_port}").parse().unwrap();

let network_config = TestConfigBuilder::default().build();
Expand Down
2 changes: 1 addition & 1 deletion crates/cliquenet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ hotshot-types = { workspace = true, optional = true }

[dev-dependencies]
criterion = "0.8.1"
portpicker = { workspace = true }
quickcheck = { workspace = true }
test-utils = { workspace = true }
tracing-subscriber = { workspace = true }

[[bench]]
Expand Down
Loading
Loading