Expose db change batches over control
This commit is contained in:
parent
8ffe1d714c
commit
a44eef3126
8 changed files with 130 additions and 15 deletions
|
|
@ -758,6 +758,25 @@ pub fn handle_request(
|
|||
db: db_resource_from_stored(&stored)?,
|
||||
})
|
||||
}
|
||||
ControlRequest::DbChanges {
|
||||
name,
|
||||
after_db_version,
|
||||
limit,
|
||||
} => {
|
||||
geth_db::validate_db_name(&name).map_err(|_| NodeError::InvalidDbName(name.clone()))?;
|
||||
let stored = store
|
||||
.get_db_resource_by_name(&name)?
|
||||
.ok_or_else(|| NodeError::DbNotFound(name.clone()))?;
|
||||
let batch = geth_db::extract_crsqlite_changes(
|
||||
Path::new(&stored.path),
|
||||
after_db_version,
|
||||
limit,
|
||||
)?;
|
||||
Ok(ControlResponse::DbChanges {
|
||||
db: db_resource_from_stored(&stored)?,
|
||||
batch,
|
||||
})
|
||||
}
|
||||
ControlRequest::KvCreate { name } => {
|
||||
geth_kv::validate_kv_name(&name).map_err(|_| NodeError::InvalidKvName(name.clone()))?;
|
||||
let resource_id = format!("resource:kv:{name}");
|
||||
|
|
|
|||
Loading…
Reference in a new issue