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
444 for (id, token_uri) in tokens {444 for (id, token_uri) in tokens {
445 let id: u32 = id.try_into().map_err(|_| "token id overflow")?;445 let id: u32 = id.try_into().map_err(|_| "token id overflow")?;
446 if id != expected_index {446 if id != expected_index {
447 panic!("item id should be next ({}) but got {}", expected_index, id);447 return Err("item id should be next".into());
448 }448 }
449 expected_index = expected_index.checked_add(1).ok_or("item id overflow")?;449 expected_index = expected_index.checked_add(1).ok_or("item id overflow")?;
450450