Skip to content

Commit

Permalink
fixes for Marketplaceconfig
Browse files Browse the repository at this point in the history
hotshot-rc0.5.70 will add `MarkeplaceConfig`



---------

Co-authored-by: tbro <[email protected]>
  • Loading branch information
tbro and tbro committed Aug 7, 2024
1 parent 98fe33c commit 7519a04
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 51 deletions.
73 changes: 38 additions & 35 deletions Cargo.lock

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

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

[package]
name = "hotshot-query-service"
version = "0.1.50"
version = "0.1.51"
authors = ["Espresso Systems <[email protected]>"]
edition = "2021"
license = "GPL-3.0-or-later"
Expand Down Expand Up @@ -63,7 +63,7 @@ ark-serialize = "0.4.2"
async-compatibility-layer = { version = "1.1", default-features = false, features = [
"logging-utils",
] }
async-lock = "2.8"
async-lock = "3.3.0"
async-std = { version = "1.9.0", features = ["unstable", "attributes"] }
async-trait = "0.1"
bincode = "1.3"
Expand All @@ -75,9 +75,9 @@ derivative = "2.2"
derive_more = "0.99"
either = "1.12"
futures = "0.3"
hotshot = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.68" }
hotshot-testing = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.68" }
hotshot-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.68" }
hotshot = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.70" }
hotshot-testing = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.70" }
hotshot-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.70" }
itertools = "0.12.1"
jf-merkle-tree = { version = "0.1.0", git = "https://github.com/EspressoSystems/jellyfish", tag = "0.4.5", features = [
"std",
Expand Down Expand Up @@ -119,7 +119,7 @@ tokio-postgres = { version = "0.7", optional = true, default-features = false, f

# Dependencies enabled by feature "testing".
espresso-macros = { git = "https://github.com/EspressoSystems/espresso-macros.git", tag = "0.1.0", optional = true }
hotshot-example-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.68", optional = true }
hotshot-example-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.70", optional = true }
portpicker = { version = "0.1", optional = true }
rand = { version = "0.8", optional = true }
spin_sleep = { version = "1.2", optional = true }
Expand All @@ -140,7 +140,7 @@ backtrace-on-stack-overflow = { version = "0.3", optional = true }
clap = { version = "4.5", features = ["derive", "env"] }
espresso-macros = { git = "https://github.com/EspressoSystems/espresso-macros.git", tag = "0.1.0" }
generic-array = "0.14"
hotshot-example-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.68" }
hotshot-example-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.70" }
portpicker = "0.1"
rand = "0.8"
reqwest = "0.12.3"
Expand Down
9 changes: 6 additions & 3 deletions examples/simple-server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use futures::future::{join_all, try_join_all};
use hotshot::{
traits::implementations::{MasterMap, MemoryNetwork},
types::{SignatureKey, SystemContextHandle},
HotShotInitializer, Memberships, SystemContext,
HotShotInitializer, MarketplaceConfig, Memberships, SystemContext,
};
use hotshot_example_types::{
auction_results_provider_types::TestAuctionResultsProvider, state_types::TestInstanceState,
Expand All @@ -48,7 +48,7 @@ use hotshot_types::{
traits::{election::Membership, network::Topic},
ExecutionType, HotShotConfig, PeerConfig, ValidatorConfig,
};
use std::{num::NonZeroUsize, time::Duration};
use std::{num::NonZeroUsize, str::FromStr, time::Duration};
use url::Url;
use vbs::version::StaticVersionType;

Expand Down Expand Up @@ -275,7 +275,10 @@ async fn init_consensus(
.unwrap(),
ConsensusMetricsValue::new(&*data_source.populate_metrics()),
storage,
TestAuctionResultsProvider::default(),
MarketplaceConfig {
auction_results_provider: Arc::new(TestAuctionResultsProvider::default()),
generic_builder_url: Url::from_str("https://some.url").unwrap(),
},
)
.await
.unwrap()
Expand Down
11 changes: 8 additions & 3 deletions src/testing/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use futures::{
use hotshot::{
traits::implementations::{MasterMap, MemoryNetwork},
types::{Event, SystemContextHandle},
HotShotInitializer, Memberships, SystemContext,
HotShotInitializer, MarketplaceConfig, Memberships, SystemContext,
};
use hotshot_example_types::{
auction_results_provider_types::TestAuctionResultsProvider, state_types::TestInstanceState,
Expand All @@ -43,9 +43,9 @@ use hotshot_types::{
traits::{election::Membership, network::Topic, signature_key::SignatureKey as _},
ExecutionType, HotShotConfig, PeerConfig, ValidatorConfig,
};
use std::fmt::Display;
use std::num::NonZeroUsize;
use std::time::Duration;
use std::{fmt::Display, str::FromStr};
use tracing::{info_span, Instrument};
use url::Url;

Expand Down Expand Up @@ -207,7 +207,12 @@ impl<D: DataSourceLifeCycle + UpdateStatusData> MockNetwork<D> {
.unwrap(),
ConsensusMetricsValue::new(&*data_source.populate_metrics()),
hs_storage,
TestAuctionResultsProvider::default(),
MarketplaceConfig {
auction_results_provider: Arc::new(
TestAuctionResultsProvider::default(),
),
generic_builder_url: Url::from_str("https://some.url").unwrap(),
},
)
.await
.unwrap()
Expand Down
5 changes: 2 additions & 3 deletions src/testing/mocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ use hotshot::traits::{
election::static_committee::GeneralStaticCommittee, implementations::MemoryNetwork,
NodeImplementation,
};
use hotshot_example_types::auction_results_provider_types::TestAuctionResultsProvider;
use hotshot_example_types::{
auction_results_provider_types::TestAuctionResult,
auction_results_provider_types::{TestAuctionResult, TestAuctionResultsProvider},
block_types::{TestBlockHeader, TestBlockPayload, TestTransaction},
state_types::{TestInstanceState, TestValidatedState},
storage_types::TestStorage,
Expand Down Expand Up @@ -137,7 +136,7 @@ impl NodeType for MockTypes {
type BuilderSignatureKey = BLSPubKey;
type Base = StaticVersion<0, 1>;
type Upgrade = StaticVersion<0, 2>;
type AuctionResult = MockAuctionResults;
type AuctionResult = TestAuctionResult;
const UPGRADE_HASH: [u8; 32] = [
1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
0, 0,
Expand Down

0 comments on commit 7519a04

Please sign in to comment.