From dd8a13dfd6b64e3d8156b0c2f5358d55e694589f Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 28 Apr 2022 20:29:28 +0000 Subject: [PATCH] fix: remove possible panics --- --- a/pallets/evm-transaction-payment/src/lib.rs +++ b/pallets/evm-transaction-payment/src/lib.rs @@ -154,7 +154,7 @@ ))) }) // FIXME: it may fail with DispatchError in case of depth limit - .map_err(|e| panic!("err?!")).ok()??; + .ok()??; Some(sponsor.as_sub().clone()) } _ => None, --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -444,7 +444,7 @@ for (id, token_uri) in tokens { let id: u32 = id.try_into().map_err(|_| "token id overflow")?; if id != expected_index { - panic!("item id should be next ({}) but got {}", expected_index, id); + return Err("item id should be next".into()); } expected_index = expected_index.checked_add(1).ok_or("item id overflow")?; -- gitstuff