1
// Copyright (C) Moondance Labs Ltd.
2
// This file is part of Tanssi.
3

            
4
// Tanssi is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8

            
9
// Tanssi is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
// GNU General Public License for more details.
13

            
14
// You should have received a copy of the GNU General Public License
15
// along with Tanssi.  If not, see <http://www.gnu.org/licenses/>
16

            
17
//! # Author Noting Inherent Primitives
18
//!
19
//! This crate defines those primitives that should be taken into account when building
20
//! the author-noting pallet inherent
21
//!
22
//! In particular this crate contains:
23
//! - The Inherent identifier
24
//! - The client side trait implementations to introduce the inherent
25
//! - The mock version that gets used both in test files and manual seal
26
//! - The sproof builder that generates a fake proof that mimics the relay chain sproof
27

            
28
#![cfg_attr(not(feature = "std"), no_std)]
29

            
30
#[cfg(feature = "std")]
31
mod client_side;
32

            
33
#[cfg(feature = "std")]
34
mod mock;
35
#[cfg(feature = "std")]
36
pub use mock::*;
37

            
38
#[cfg(test)]
39
mod tests;
40

            
41
use {
42
    parity_scale_codec::{Decode, Encode},
43
    scale_info::TypeInfo,
44
    sp_inherents::InherentIdentifier,
45
};
46

            
47
618
#[derive(Encode, Decode, sp_core::RuntimeDebug, Clone, PartialEq, TypeInfo)]
48
pub struct OwnParachainInherentData {
49
    pub relay_storage_proof: sp_trie::StorageProof,
50
}
51

            
52
// Identifier of the author-noting inherent
53
pub const INHERENT_IDENTIFIER: InherentIdentifier = *b"auno1337";