Get the weight of a validator It expects ID addresses as an input
(&self, rt: &impl Runtime, addr: &Address)
| 20 | /// Get the weight of a validator |
| 21 | /// It expects ID addresses as an input |
| 22 | pub fn get_validator_weight(&self, rt: &impl Runtime, addr: &Address) -> Option<TokenAmount> { |
| 23 | self.validators |
| 24 | .validators() |
| 25 | .iter() |
| 26 | .find(|x| match rt.resolve_address(&x.addr) { |
| 27 | Some(id) => id == *addr, |
| 28 | None => false, |
| 29 | }) |
| 30 | .map(|v| v.weight.clone()) |
| 31 | } |
| 32 | } |
nothing calls this directly
no outgoing calls
no test coverage detected