mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-11 06:01:06 +00:00
update kvdb & co (#12312)
* upgrade kvdb & co * remove patch * update Cargo.lock * upgrade impl-serde * fix parsing test * actually fix it * FFS
This commit is contained in:
@@ -115,7 +115,7 @@ pub fn upgrade_db<Block: BlockT>(db_path: &Path, db_type: DatabaseType) -> Upgra
|
||||
/// 2) transactions column is added;
|
||||
fn migrate_1_to_2<Block: BlockT>(db_path: &Path, _db_type: DatabaseType) -> UpgradeResult<()> {
|
||||
let db_cfg = DatabaseConfig::with_columns(V1_NUM_COLUMNS);
|
||||
let db = Database::open(&db_cfg, db_path)?;
|
||||
let mut db = Database::open(&db_cfg, db_path)?;
|
||||
db.add_column().map_err(Into::into)
|
||||
}
|
||||
|
||||
@@ -126,7 +126,10 @@ fn migrate_2_to_3<Block: BlockT>(db_path: &Path, _db_type: DatabaseType) -> Upgr
|
||||
let db = Database::open(&db_cfg, db_path)?;
|
||||
|
||||
// Get all the keys we need to update
|
||||
let keys: Vec<_> = db.iter(columns::JUSTIFICATIONS).map(|entry| entry.0).collect();
|
||||
let keys: Vec<_> = db
|
||||
.iter(columns::JUSTIFICATIONS)
|
||||
.map(|r| r.map(|e| e.0))
|
||||
.collect::<Result<_, _>>()?;
|
||||
|
||||
// Read and update each entry
|
||||
let mut transaction = db.transaction();
|
||||
@@ -152,7 +155,7 @@ fn migrate_2_to_3<Block: BlockT>(db_path: &Path, _db_type: DatabaseType) -> Upgr
|
||||
/// 2) BODY_INDEX column is added;
|
||||
fn migrate_3_to_4<Block: BlockT>(db_path: &Path, _db_type: DatabaseType) -> UpgradeResult<()> {
|
||||
let db_cfg = DatabaseConfig::with_columns(V3_NUM_COLUMNS);
|
||||
let db = Database::open(&db_cfg, db_path)?;
|
||||
let mut db = Database::open(&db_cfg, db_path)?;
|
||||
db.add_column().map_err(Into::into)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user