MCPcopy Create free account
hub / github.com/ChainSafe/Delorean-Protocol / get_validator_weight

Method get_validator_weight

ipc/api/src/runtime.rs:22–31  ·  view source on GitHub ↗

Get the weight of a validator It expects ID addresses as an input

(&self, rt: &impl Runtime, addr: &Address)

Source from the content-addressed store, hash-verified

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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected