referrerpolicy=no-referrer-when-downgrade
polkadot_node_subsystem_util

Function sign

Source
pub fn sign(
    keystore: &KeystorePtr,
    key: &ValidatorId,
    data: &[u8],
) -> Result<Option<ValidatorSignature>, Error>
Expand description

Sign the given data with the given validator ID.

Returns Ok(None) if the private key that corresponds to that validator ID is not found in the given keystore. Returns an error if the key could not be used for signing.