Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Add TypeInfo for TransactionValidityError #11599

Merged
merged 3 commits into from
Jun 14, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions primitives/runtime/src/transaction_validity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use crate::{
codec::{Decode, Encode},
RuntimeDebug,
};
use scale_info::TypeInfo;
use sp_std::prelude::*;

/// Priority for a transaction. Additive. Higher is better.
Expand All @@ -34,7 +35,7 @@ pub type TransactionLongevity = u64;
pub type TransactionTag = Vec<u8>;

/// An invalid transaction validity.
#[derive(Clone, PartialEq, Eq, Encode, Decode, Copy, RuntimeDebug)]
#[derive(Clone, PartialEq, Eq, Encode, Decode, Copy, RuntimeDebug, TypeInfo)]
#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))]
pub enum InvalidTransaction {
/// The call of the transaction is not expected.
Expand Down Expand Up @@ -117,7 +118,7 @@ impl From<InvalidTransaction> for &'static str {
}

/// An unknown transaction validity.
#[derive(Clone, PartialEq, Eq, Encode, Decode, Copy, RuntimeDebug)]
#[derive(Clone, PartialEq, Eq, Encode, Decode, Copy, RuntimeDebug, TypeInfo)]
#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))]
pub enum UnknownTransaction {
/// Could not lookup some information that is required to validate the transaction.
Expand All @@ -141,7 +142,7 @@ impl From<UnknownTransaction> for &'static str {
}

/// Errors that can occur while checking the validity of a transaction.
#[derive(Clone, PartialEq, Eq, Encode, Decode, Copy, RuntimeDebug)]
#[derive(Clone, PartialEq, Eq, Encode, Decode, Copy, RuntimeDebug, TypeInfo)]
#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))]
pub enum TransactionValidityError {
/// The transaction is invalid.
Expand Down