pub fn register_validator(
        &mut self,
        space_delim_strings: &[&str],
        is_blocking: bool,
    ) -> Result<()> {
        ensure!(
            space_delim_strings[0] == "register_validator",
            "inconsistent command '{}' for register_validator",
            space_delim_strings[0]
        );
        ensure!(
            space_delim_strings.len() == 9,
            "Invalid number of arguments for registering validator"
        );
        let (address, _) = self.get_account_address_from_parameter(space_delim_strings[1])?;
        let private_key = Ed25519PrivateKey::from_encoded_string(space_delim_strings[2])?;
        let consensus_public_key = Ed25519PublicKey::from_encoded_string(space_delim_strings[3])?;
        let network_signing_key = Ed25519PublicKey::from_encoded_string(space_delim_strings[4])?;
        let network_identity_key = x25519::PublicKey::from_encoded_string(space_delim_strings[5])?;
        let network_address = NetworkAddress::from_str(space_delim_strings[6])?;
        let network_address = RawNetworkAddress::try_from(&network_address)?;
        let fullnode_identity_key = x25519::PublicKey::from_encoded_string(space_delim_strings[7])?;
        let fullnode_network_address = NetworkAddress::from_str(space_delim_strings[8])?;
        let fullnode_network_address = RawNetworkAddress::try_from(&fullnode_network_address)?;
        let mut sender = Self::get_account_data_from_address(
            &mut self.client,
            address,
            true,
            Some(KeyPair::from(private_key)),
            None,
        )?;
        let program = encode_register_validator_script(
            consensus_public_key.to_bytes().to_vec(),
            network_signing_key.to_bytes().to_vec(),
            network_identity_key.to_bytes(),
            network_address.into(),
            fullnode_identity_key.to_bytes(),
            fullnode_network_address.into(),
        );
        let txn = self.create_txn_to_submit(
            TransactionPayload::Script(program),
            &sender,
            None,
            None,
            None,
        )?;
        self.client.submit_transaction(Some(&mut sender), txn)?;
        if is_blocking {
            self.wait_for_transaction(sender.address, sender.sequence_number)?;
        }
        Ok(())
    }
/// Register an account as validator candidate with ValidatorConfig
Register an account as validator candidate with ValidatorConfig
Register an account as validator candidate with ValidatorConfig
pub fn register_validator(
        &mut self,
        space_delim_strings: &[&str],
        is_blocking: bool,
    ) -> Result<()> {
        ensure!(
            space_delim_strings[0] == "register_validator",
            "inconsistent command '{}' for register_validator",
            space_delim_strings[0]
        );
        ensure!(
            space_delim_strings.len() == 9,
            "Invalid number of arguments for registering validator"
        );
        let (address, _) = self.get_account_address_from_parameter(space_delim_strings[1])?;
        let private_key = Ed25519PrivateKey::from_encoded_string(space_delim_strings[2])?;
        let consensus_public_key = Ed25519PublicKey::from_encoded_string(space_delim_strings[3])?;
        let network_signing_key = Ed25519PublicKey::from_encoded_string(space_delim_strings[4])?;
        let network_identity_key = x25519::PublicKey::from_encoded_string(space_delim_strings[5])?;
        let network_address = NetworkAddress::from_str(space_delim_strings[6])?;
        let network_address = RawNetworkAddress::try_from(&network_address)?;
        let fullnode_identity_key = x25519::PublicKey::from_encoded_string(space_delim_strings[7])?;
        let fullnode_network_address = NetworkAddress::from_str(space_delim_strings[8])?;
        let fullnode_network_address = RawNetworkAddress::try_from(&fullnode_network_address)?;
        let mut sender = Self::get_account_data_from_address(
            &mut self.client,
            address,
            true,
            Some(KeyPair::from(private_key)),
            None,
        )?;
        let program = encode_register_validator_script(
            consensus_public_key.to_bytes().to_vec(),
            network_signing_key.to_bytes().to_vec(),
            network_identity_key.to_bytes(),
            network_address.into(),
            fullnode_identity_key.to_bytes(),
            fullnode_network_address.into(),
        );
        let txn = self.create_txn_to_submit(
            TransactionPayload::Script(program),
            &sender,
            None,
            None,
            None,
        )?;
        self.client.submit_transaction(Some(&mut sender), txn)?;
        if is_blocking {
            self.wait_for_transaction(sender.address, sender.sequence_number)?;
        }
        Ok(())
    }
pub fn register_validator ( & mut self , space_delim_strings : & [ & str ] , is_blocking : bool , ) -> Result < ( ) > { ensure ! ( space_delim_strings [ 0 ] " " " " space_delim_strings [ 0 ] ) ; ensure ! ( space_delim_strings len ( ) 9 " " ) ; let ( address , _ ) = self . get_account_address_from_parameter ( space_delim_strings [ 1 ] ) ? ; let private_key = Ed25519PrivateKey :: from_encoded_string ( space_delim_strings [ 2 ] ) ? ; let consensus_public_key = Ed25519PublicKey :: from_encoded_string ( space_delim_strings [ 3 ] ) ? ; let network_signing_key = Ed25519PublicKey :: from_encoded_string ( space_delim_strings [ 4 ] ) ? ; let network_identity_key = x25519 :: PublicKey :: from_encoded_string ( space_delim_strings [ 5 ] ) ? ; let network_address = NetworkAddress :: from_str ( space_delim_strings [ 6 ] ) ? ; let network_address = RawNetworkAddress :: try_from ( & network_address ) ? ; let fullnode_identity_key = x25519 :: PublicKey :: from_encoded_string ( space_delim_strings [ 7 ] ) ? ; let fullnode_network_address = NetworkAddress :: from_str ( space_delim_strings [ 8 ] ) ? ; let fullnode_network_address = RawNetworkAddress :: try_from ( & fullnode_network_address ) ? ; let mut sender = Self :: get_account_data_from_address ( & mut self . client , address , true , Some ( KeyPair :: from ( private_key ) ) , None , ) ? ; let program = encode_register_validator_script ( consensus_public_key . to_bytes ( ) . to_vec ( ) , network_signing_key . to_bytes ( ) . to_vec ( ) , network_identity_key . to_bytes ( ) , network_address . into ( ) , fullnode_identity_key . to_bytes ( ) , fullnode_network_address . into ( ) , ) ; let txn = self . create_txn_to_submit ( TransactionPayload :: Script ( program ) , & sender , None , None , None , ) ? ; self . client . submit_transaction ( Some ( & mut sender ) , txn ) ? ; if is_blocking { self . wait_for_transaction ( sender . address , sender . sequence_number ) ? ; } Ok ( ( ) ) }
Register an account as validator candidate with ValidatorConfig
Register an account as validator candidate with ValidatorConfig
&mut self
space_delim_strings
&[&str]
is_blocking
bool
&mut self
space_delim_strings
&[&str]
is_blocking
bool