subxt_core/utils/multi_signature.rs
1// Copyright 2019-2024 Parity Technologies (UK) Ltd.
2// This file is dual-licensed as Apache-2.0 or GPL-3.0.
3// see LICENSE for license details.
4
5//! The "default" Substrate/Polkadot Signature type. This is used in codegen, as well as signing related bits.
6//! This doesn't contain much functionality itself, but is easy to convert to/from an `sp_runtime::MultiSignature`
7//! for instance, to gain functionality without forcing a dependency on Substrate crates here.
8
9use codec::{Decode, Encode};
10
11/// Signature container that can store known signature types. This is a simplified version of
12/// `sp_runtime::MultiSignature`. To obtain more functionality, convert this into that type.
13#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, Debug, scale_info::TypeInfo)]
14pub enum MultiSignature {
15 /// An Ed25519 signature.
16 Ed25519([u8; 64]),
17 /// An Sr25519 signature.
18 Sr25519([u8; 64]),
19 /// An ECDSA/SECP256k1 signature (a 512-bit value, plus 8 bits for recovery ID).
20 Ecdsa([u8; 65]),
21}