Skip to main content

encode_multi_signature

Function encode_multi_signature 

Source
pub fn encode_multi_signature(
    sig_bytes: &[u8],
    scheme: CryptoScheme,
) -> Result<Vec<u8>, String>
Expand description

Wrap a raw signature in a Substrate MultiSignature SCALE envelope.

Substrate MultiSignature enum order:

  • Ed25519: variant 0x00, 64 bytes
  • Sr25519: variant 0x01, 64 bytes
  • Ecdsa: variant 0x02, 65 bytes

Returns Err if sig_bytes has the wrong length for the chosen scheme.