use parity_scale_codec::{Decode, Encode};
use sp_runtime::Justification;
use crate::{
abft::SignatureSet,
phron_primitives::{AuthoritySignature, PHRON_ENGINE_ID},
crypto::Signature,
};
mod compatibility;
pub use compatibility::{backwards_compatible_decode, versioned_encode, Error as DecodeError};
const LOG_TARGET: &str = "phron-justification";
#[derive(Clone, Encode, Decode, Debug, PartialEq, Eq)]
pub enum PhronJustification {
CommitteeMultisignature(SignatureSet<Signature>),
EmergencySignature(AuthoritySignature),
}
impl From<PhronJustification> for Justification {
fn from(val: PhronJustification) -> Self {
(PHRON_ENGINE_ID, versioned_encode(val))
}
}