difftreelog
fix remove possible panics
in: master
2 files changed
pallets/evm-transaction-payment/src/lib.rsdiffbeforeafterboth154 )))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 limit157 .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,pallets/nonfungible/src/erc.rsdiffbeforeafterboth444 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