/// Produces a set of OperatorAssignments from the remote storage.
Produces a set of OperatorAssignments from the remote storage.
Produces a set of OperatorAssignments from the remote storage .
pub fn operator_assignments(&self, layout: &Layout) -> Result<Vec<OperatorAssignment>, Error> {
        let mut operator_assignments = Vec::new();
        for owner in layout.owners.iter() {
            let owner_config = self.backend.backend.clone();
            let owner_config = owner_config.set_namespace(owner.into());
            let owner_storage = owner_config.create_storage(RemoteStorage)?;
            let owner_key = owner_storage
                .get(OWNER_KEY)
                .map_err(|e| Error::RemoteStorageReadError(OWNER_KEY, e.to_string()))?
                .value
                .ed25519_public_key()
                .map_err(|e| Error::RemoteStorageReadError(OWNER_KEY, e.to_string()))?;
            let operator_name = owner_storage
                .get(constants::VALIDATOR_OPERATOR)
                .map_err(|e| {
                    Error::RemoteStorageReadError(constants::VALIDATOR_OPERATOR, e.to_string())
                })?
                .value
                .string()
                .unwrap();
            let operator_account = self.fetch_operator_account(operator_name)?;
            let set_operator_script =
                transaction_builder::encode_set_validator_operator_script(operator_account);
            operator_assignments.push((owner_key, set_operator_script));
        }
        Ok(operator_assignments)
    }
pub fn operator_assignments ( & self , layout : & Layout ) -> Result < Vec < OperatorAssignment > , Error > { let mut operator_assignments = Vec :: new ( ) ; for owner in layout . owners . iter ( ) { let owner_config = self . backend . backend . clone ( ) ; let owner_config = owner_config . set_namespace ( owner . into ( ) ) ; let owner_storage = owner_config . create_storage ( RemoteStorage ) ? ; let owner_key = owner_storage . get ( OWNER_KEY ) . map_err ( | e | Error :: RemoteStorageReadError ( OWNER_KEY , e . to_string ( ) ) ) ? . value . ed25519_public_key ( ) . map_err ( | e | Error :: RemoteStorageReadError ( OWNER_KEY , e . to_string ( ) ) ) ? ; let operator_name = owner_storage . get ( constants :: VALIDATOR_OPERATOR ) . map_err ( | e | { Error :: RemoteStorageReadError ( constants :: VALIDATOR_OPERATOR , e . to_string ( ) ) } ) ? . value . string ( ) . unwrap ( ) ; let operator_account = self . fetch_operator_account ( operator_name ) ? ; let set_operator_script = transaction_builder :: encode_set_validator_operator_script ( operator_account ) ; operator_assignments . push ( ( owner_key , set_operator_script ) ) ; } Ok ( operator_assignments ) }
Produces a set of OperatorAssignments from the remote storage.
Produces a set of OperatorAssignments from the remote storage .
&self
layout
&Layout