feat(reth_db/mdbx): fix API regression in DatabaseArguments (#7323)

Co-authored-by: lmittmann <lmittmann@users.noreply.github.com>
This commit is contained in:
lmittmann
2024-03-26 13:57:29 +01:00
committed by GitHub
parent d9ce894fa3
commit 5968e9f3da
2 changed files with 3 additions and 6 deletions

View File

@@ -58,7 +58,7 @@ impl DatabaseEnvKind {
}
/// Arguments for database initialization.
#[derive(Clone, Debug)]
#[derive(Clone, Debug, Default)]
pub struct DatabaseArguments {
/// Client version that accesses the database.
client_version: ClientVersion,

View File

@@ -1,4 +1,4 @@
use reth_db::{mdbx::DatabaseArguments, models::client_version::ClientVersion, open_db_read_only};
use reth_db::open_db_read_only;
use reth_primitives::{Address, ChainSpecBuilder, B256};
use reth_provider::{
AccountReader, BlockReader, BlockSource, HeaderProvider, ProviderFactory, ReceiptProvider,
@@ -19,10 +19,7 @@ fn main() -> eyre::Result<()> {
// doing in 2 steps.
let db_path = std::env::var("RETH_DB_PATH")?;
let db_path = Path::new(&db_path);
let db = open_db_read_only(
db_path.join("db").as_path(),
DatabaseArguments::new(ClientVersion::default()),
)?;
let db = open_db_read_only(db_path.join("db").as_path(), Default::default())?;
// Instantiate a provider factory for Ethereum mainnet using the provided DB.
// TODO: Should the DB version include the spec so that you do not need to specify it here?