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

Commit

Permalink
Add TypeInfo (paritytech#11599)
Browse files Browse the repository at this point in the history
  • Loading branch information
boundless-forest authored and DaviRain-Su committed Aug 23, 2022
1 parent 3c3e0a4 commit 2e19172
Showing 1 changed file with 4 additions and 3 deletions.
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

0 comments on commit 2e19172

Please sign in to comment.