git.delta.rocks / unique-network / refs/commits / dd8a13dfd6b6

difftreelog

fix remove possible panics

Yaroslav Bolyukin2022-04-28parent: #2f9c8d4.patch.diff
in: master

2 files changed

modifiedpallets/evm-transaction-payment/src/lib.rsdiffbeforeafterboth
154 )))154 )))
155 })155 })
156 // FIXME: it may fail with DispatchError in case of depth limit156 // FIXME: it may fail with DispatchError in case of depth limit
157 .map_err(|e| panic!("err?!")).ok()??;157 .ok()??;
158 Some(sponsor.as_sub().clone())158 Some(sponsor.as_sub().clone())
159 }159 }
160 _ => None,160 _ => None,
modifiedpallets/nonfungible/src/erc.rsdiffbeforeafterboth
--- 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")?;