Skip to content

Commit

Permalink
Create tempdir for tests (#626)
Browse files Browse the repository at this point in the history
* Use temp_dir to create a temporary directory for test db

* Make db_connector receive path

* Pass db path to sov-stf-runner

* Pass path down

* Pass db path for DB

* Separate rollup from da storage paths

* Make em pass

* Fix some more

* Pass db name to test

* Update prover tests

* Remove usage of thread name

* Fix rollup config

* Create db_directory if it doesn't exist

* Add pg connector db name param

* Make it compile

* Cleanup

* Clippy

* Use da_db in execute_blocks

* Copy fullnode db directory

* Always use passed db name

* Not multi-threaded yet

* Fix clippy

* Restore prints

* Remove unwrap

* Don't use tempdir if not using service

* Resolve PR feedback

* Quote path

* Fix clippy

* Add da db to mock configs

* Add db-path where it's missing
  • Loading branch information
rakanalh authored May 28, 2024
1 parent f99f791 commit 3650b63
Show file tree
Hide file tree
Showing 31 changed files with 627 additions and 323 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions bin/citrea/configs/mock-dockerized/rollup_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ prover_da_pub_key = ""

[da]
sender_address = "0000000000000000000000000000000000000000000000000000000000000000"
db_path = "da-db"

[storage]
# The path to the rollup's data directory. Paths that do not begin with `/` are interpreted as relative paths.
Expand Down
1 change: 1 addition & 0 deletions bin/citrea/configs/mock/rollup_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ prover_da_pub_key = ""

[da]
sender_address = "0000000000000000000000000000000000000000000000000000000000000000"
db_path = "da-db"

[storage]
# The path to the rollup's data directory. Paths that do not begin with `/` are interpreted as relative paths.
Expand Down
1 change: 1 addition & 0 deletions bin/citrea/configs/mock/sequencer_rollup_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ prover_da_pub_key = ""

[da]
sender_address = "0000000000000000000000000000000000000000000000000000000000000000"
db_path = "da-db"

[storage]
# The path to the rollup's data directory. Paths that do not begin with `/` are interpreted as relative paths.
Expand Down
1 change: 1 addition & 0 deletions bin/citrea/configs/mocknet/rollup_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ prover_da_pub_key = ""

[da]
sender_address = "0000000000000000000000000000000000000000000000000000000000000000"
db_path = "da-db"

[storage]
# The path to the rollup's data directory. Paths that do not begin with `/` are interpreted as relative paths.
Expand Down
1 change: 1 addition & 0 deletions bin/citrea/configs/mocknet/sequencer_rollup_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ prover_da_pub_key = ""

[da]
sender_address = "0000000000000000000000000000000000000000000000000000000000000000"
db_path = "da-db"

[storage]
# The path to the rollup's data directory. Paths that do not begin with `/` are interpreted as relative paths.
Expand Down
2 changes: 1 addition & 1 deletion bin/citrea/src/mock_rollup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl RollupBlueprint for MockDemoRollup {
&self,
rollup_config: &RollupConfig<Self::DaConfig>,
) -> Self::DaService {
MockDaService::new(rollup_config.da.sender_address)
MockDaService::new(rollup_config.da.sender_address, &rollup_config.da.db_path)
}

async fn create_prover_service(
Expand Down
Loading

0 comments on commit 3650b63

Please sign in to comment.