-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simple metadata to distinguish parachain template from standalone tem…
…plate (#211)
- Loading branch information
1 parent
9071010
commit eed8882
Showing
7 changed files
with
59 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//! A simple type to use as metadata. For now the metadata just communicates whether we | ||
//! are dealing with a parachain or not. | ||
use parity_scale_codec::{Decode, Encode}; | ||
#[derive(Default, Debug, Encode, Decode)] | ||
pub struct TuxedoMetadata { | ||
/// Placeholder for the scale info type registry that will hopefully eventually go here. | ||
_registry: (), | ||
/// Indicator of whether this chain is a parachain or not. | ||
parachain: bool, | ||
} | ||
|
||
impl TuxedoMetadata { | ||
pub fn new_parachain() -> Self { | ||
Self { | ||
_registry: (), | ||
parachain: true, | ||
} | ||
} | ||
|
||
pub fn is_parachain(&self) -> bool { | ||
self.parachain | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters