return error instead of expect in feasibility_check (#12745)

* Update lib.rs

* make defensive

* fmt

* fix batching migration

* fix

* fix

Co-authored-by: parity-processbot <>
This commit is contained in:
Kian Paimani
2022-11-23 08:38:34 +00:00
committed by GitHub
parent 7ea85cb9ae
commit 3e48c4bc02
2 changed files with 12 additions and 7 deletions
@@ -39,6 +39,9 @@ pub mod v1 {
);
if current == 1 && onchain == 0 {
// update the version nonetheless.
current.put::<Pallet<T>>();
// if a head exists, then we put them back into the queue.
if Head::<T>::exists() {
if let Some((stash, _, deposit)) =
@@ -48,7 +51,6 @@ pub mod v1 {
.defensive()
{
Queue::<T>::insert(stash, deposit);
current.put::<Pallet<T>>();
} else {
// not much we can do here -- head is already deleted.
}