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

Function from_contract_validators

ipc/api/src/validator.rs:42–57  ·  view source on GitHub ↗
(
    vals: Vec<subnet_actor_getter_facet::Validator>,
)

Source from the content-addressed store, hash-verified

40}
41
42pub fn from_contract_validators(
43 vals: Vec<subnet_actor_getter_facet::Validator>,
44) -> anyhow::Result<Vec<Validator>> {
45 let result: Result<Vec<Validator>, _> = vals
46 .into_iter()
47 .map(|validator| {
48 Ok(Validator {
49 addr: ethers_address_to_fil_address(&validator.addr)?,
50 weight: eth_to_fil_amount(&validator.weight)?,
51 metadata: validator.metadata.to_vec(),
52 })
53 })
54 .collect();
55
56 result
57}

Callers 1

get_genesis_infoMethod · 0.85

Calls 4

eth_to_fil_amountFunction · 0.85
collectMethod · 0.80
to_vecMethod · 0.80

Tested by

no test coverage detected