mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 17:01:09 +00:00
Fix revert for non finalized blocks (#1479)
* fix: temporal modification to make revert works for non finalized blocks * fix: print info when the number of blocks asked to revert is higher than the number of reversible blocks * fix: remove function get_db_path_for_subcommand and remove it from all subcommands * fix: revert only non finalized blocks * fix: improve printed information for revert command * fix: new wasm file * chore: remove unused parameter * fix: revert log logic * fix: subcommands should take sub_matches instead of matches * fix: removing confusing message
This commit is contained in:
@@ -154,7 +154,12 @@ pub fn revert_chain<F>(config: FactoryFullConfiguration<F>, blocks: FactoryBlock
|
||||
let client = new_client::<F>(&config)?;
|
||||
let reverted = client.revert(blocks)?;
|
||||
let info = client.info()?.chain;
|
||||
info!("Reverted {} blocks. Best: #{} ({})", reverted, info.best_number, info.best_hash);
|
||||
|
||||
if reverted.as_() == 0 {
|
||||
info!("There aren't any non-finalized blocks to revert.");
|
||||
} else {
|
||||
info!("Reverted {} blocks. Best: #{} ({})", reverted, info.best_number, info.best_hash);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user