Skip to content

Commit

Permalink
Merge branch 'tooling-general/use-action-gh-release-action' of https:…
Browse files Browse the repository at this point in the history
…//github.com/iotaledger/iota into tooling-general/use-action-gh-release-action
  • Loading branch information
marc2332 committed Nov 27, 2024
2 parents f2d9baf + b89a718 commit dd33771
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions crates/iota-cluster-test/src/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ impl Cluster for LocalNewCluster {
Some(pg_address.clone()),
fullnode_url.clone(),
ReaderWriterConfig::writer_mode(None),
data_ingestion_path.clone(),
Some(data_ingestion_path.clone()),
None,
)
.await;
Expand All @@ -274,7 +274,7 @@ impl Cluster for LocalNewCluster {
Some(pg_address),
fullnode_url.clone(),
ReaderWriterConfig::reader_mode(indexer_address.to_string()),
data_ingestion_path,
Some(data_ingestion_path),
None,
)
.await;
Expand Down
9 changes: 6 additions & 3 deletions crates/iota-indexer/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub async fn start_test_indexer<T: R2D2Connection + Send + 'static>(
db_url: Option<String>,
rpc_url: String,
reader_writer_config: ReaderWriterConfig,
data_ingestion_path: PathBuf,
data_ingestion_path: Option<PathBuf>,
new_database: Option<&str>,
) -> (PgIndexerStore<T>, JoinHandle<Result<(), IndexerError>>) {
start_test_indexer_impl(
Expand All @@ -53,7 +53,7 @@ pub async fn start_test_indexer<T: R2D2Connection + Send + 'static>(
reader_writer_config,
// reset_database
false,
Some(data_ingestion_path),
data_ingestion_path,
CancellationToken::new(),
new_database,
)
Expand Down Expand Up @@ -86,11 +86,14 @@ pub async fn start_test_indexer_impl<T: R2D2Connection + 'static>(

let mut config = IndexerConfig {
db_url: Some(db_url.clone().into()),
// As fallback sync mechanism enable Rest Api if `data_ingestion_path` was not provided
remote_store_url: data_ingestion_path
.is_none()
.then_some(format!("{rpc_url}/api/v1")),
rpc_client_url: rpc_url,
reset_db: true,
fullnode_sync_worker: true,
rpc_server_worker: false,
remote_store_url: None,
data_ingestion_path,
..Default::default()
};
Expand Down
6 changes: 3 additions & 3 deletions crates/iota-indexer/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub async fn start_test_cluster_with_read_write_indexer(
builder_modifier: Option<Box<dyn FnOnce(TestClusterBuilder) -> TestClusterBuilder>>,
) -> (TestCluster, PgIndexerStore<PgConnection>, HttpClient) {
let temp = tempdir().unwrap().into_path();
let mut builder = TestClusterBuilder::new().with_data_ingestion_dir(temp.clone());
let mut builder = TestClusterBuilder::new();

if let Some(builder_modifier) = builder_modifier {
builder = builder_modifier(builder);
Expand All @@ -127,7 +127,7 @@ pub async fn start_test_cluster_with_read_write_indexer(
Some(get_indexer_db_url(None)),
cluster.rpc_url().to_string(),
ReaderWriterConfig::writer_mode(None),
temp.clone(),
None,
database_name,
)
.await;
Expand Down Expand Up @@ -305,7 +305,7 @@ pub async fn start_simulacrum_rest_api_with_write_indexer(
Some(get_indexer_db_url(None)),
format!("http://{}", server_url),
ReaderWriterConfig::writer_mode(None),
data_ingestion_path,
Some(data_ingestion_path),
database_name,
)
.await;
Expand Down
1 change: 1 addition & 0 deletions crates/iota-indexer/tests/rpc-tests/read_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,7 @@ fn get_total_transaction_blocks() {

runtime.block_on(async move {
indexer_wait_for_checkpoint(store, checkpoint).await;

let total_transaction_blocks = client.get_total_transaction_blocks().await.unwrap();

let fullnode_checkpoint = cluster
Expand Down
4 changes: 2 additions & 2 deletions crates/iota/src/iota_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ async fn start(
Some(pg_address.clone()),
fullnode_url.clone(),
ReaderWriterConfig::writer_mode(None),
data_ingestion_path.clone(),
Some(data_ingestion_path.clone()),
None,
)
.await;
Expand All @@ -766,7 +766,7 @@ async fn start(
Some(pg_address.clone()),
fullnode_url.clone(),
ReaderWriterConfig::reader_mode(indexer_address.to_string()),
data_ingestion_path,
Some(data_ingestion_path),
None,
)
.await;
Expand Down

0 comments on commit dd33771

Please sign in to comment.