mirror of
https://github.com/aljazceru/cdk.git
synced 2025-12-18 21:25:09 +01:00
feat: update redb (#1071)
This commit is contained in:
@@ -19,7 +19,7 @@ auth = ["cdk-common/auth"]
|
||||
[dependencies]
|
||||
async-trait.workspace = true
|
||||
cdk-common = { workspace = true, features = ["test"] }
|
||||
redb = "2.4.0"
|
||||
redb = "2.6.3"
|
||||
thiserror.workspace = true
|
||||
tracing.workspace = true
|
||||
serde.workspace = true
|
||||
|
||||
@@ -25,6 +25,9 @@ pub enum Error {
|
||||
/// Redb Storage Error
|
||||
#[error(transparent)]
|
||||
Storage(#[from] Box<redb::StorageError>),
|
||||
/// Upgrade Transaction Error
|
||||
#[error(transparent)]
|
||||
Upgrade(#[from] Box<redb::UpgradeError>),
|
||||
/// Serde Json Error
|
||||
#[error(transparent)]
|
||||
Serde(#[from] serde_json::Error),
|
||||
@@ -111,3 +114,9 @@ impl From<redb::StorageError> for Error {
|
||||
Self::Storage(Box::new(e))
|
||||
}
|
||||
}
|
||||
|
||||
impl From<redb::UpgradeError> for Error {
|
||||
fn from(e: redb::UpgradeError) -> Self {
|
||||
Self::Upgrade(Box::new(e))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,7 +156,9 @@ impl WalletRedbDatabase {
|
||||
drop(db);
|
||||
}
|
||||
|
||||
let db = Database::create(path)?;
|
||||
let mut db = Database::create(path)?;
|
||||
|
||||
db.upgrade()?;
|
||||
|
||||
Ok(Self { db: Arc::new(db) })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user