Conversation
|
note for reviewers: we are manually adding |
| // Allowed since it's actually better to panic during chain setup when there is an error | ||
| #![allow(clippy::unwrap_used)] |
There was a problem hiding this comment.
Yeah, nice to allow this in tests, benchmarks, and some node stuff like this
| T::Currency::reserve(&who, id.deposit - old_deposit)?; | ||
| T::Currency::hold( | ||
| &HoldReason::RegistryIdentity.into(), | ||
| &who, | ||
| id.deposit - old_deposit, | ||
| )?; |
There was a problem hiding this comment.
Is there a reason to do the currency -> fungible migration here? Seems unrelated to direct indexing and I think you need a migration?
There was a problem hiding this comment.
It should have gone into the 1.0 branch, but I forgot to commit it and now i'm rolling into this.
There was a problem hiding this comment.
@gregzaitsev is this what you were referring to a while back ? I remember we had some conversation about it. #353
| assert_eq!(x.len(), y.len()); | ||
| let n = x.len(); | ||
| let mut result: Vec<I32F32> = vec![I32F32::from_num(0); n]; | ||
| for i in 0..n { | ||
| if y[i] != 0 { | ||
| result[i] = x[i] / y[i]; | ||
| } | ||
| } | ||
| result | ||
| x.iter() | ||
| .zip(y) | ||
| .map(|(x_i, y_i)| { | ||
| if *y_i != 0 { | ||
| x_i / y_i | ||
| } else { | ||
| I32F32::from_num(0) | ||
| } | ||
| }) | ||
| .collect() |
This PR resolves #278 by enabling CI to detect direct indexing and calls to
unwrap.