mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 23:57:56 +00:00
Chain-selection subsystem data revert (#5350)
* Chain-selection subsystem data revert * Cargo fmt * Better code comments * Remove unwraps * Document public method * Remove duplicated 'ChainSelectionSubsystem' impl block * Fix typos * Nitpicks * Revert returns a service Error * Removed superflous error handling * Apply suggestions from code review * Rename tree 'revert' to 'revert_to' Co-authored-by: Sebastian Kunert <skunert49@gmail.com>
This commit is contained in:
@@ -435,7 +435,19 @@ pub fn run() -> Result<()> {
|
||||
|
||||
Ok(runner.async_run(|mut config| {
|
||||
let (client, backend, _, task_manager) = service::new_chain_ops(&mut config, None)?;
|
||||
Ok((cmd.run(client, backend, None).map_err(Error::SubstrateCli), task_manager))
|
||||
let aux_revert = Box::new(|client, backend, blocks| {
|
||||
service::revert_backend(client, backend, blocks, config).map_err(|err| {
|
||||
match err {
|
||||
service::Error::Blockchain(err) => err.into(),
|
||||
// Generic application-specific error.
|
||||
err => sc_cli::Error::Application(err.into()),
|
||||
}
|
||||
})
|
||||
});
|
||||
Ok((
|
||||
cmd.run(client, backend, Some(aux_revert)).map_err(Error::SubstrateCli),
|
||||
task_manager,
|
||||
))
|
||||
})?)
|
||||
},
|
||||
Some(Subcommand::PvfPrepareWorker(cmd)) => {
|
||||
|
||||
Reference in New Issue
Block a user