Get the weight of a validator It expects ID addresses as an input
(&self, rt: &impl Runtime, addr: &Address)
| 10 | /// Get the weight of a validator |
| 11 | /// It expects ID addresses as an input |
| 12 | pub fn get_validator_weight(&self, rt: &impl Runtime, addr: &Address) -> Option<TokenAmount> { |
| 13 | self.validators |
| 14 | .validators() |
| 15 | .iter() |
| 16 | .find(|x| match rt.resolve_address(&x.addr) { |
| 17 | Some(id) => id == *addr, |
| 18 | None => false, |
| 19 | }) |
| 20 | .map(|v| v.weight.clone()) |
| 21 | } |
| 22 | } |
nothing calls this directly
no test coverage detected