-
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.
- Loading branch information
1 parent
e18e601
commit 16906d1
Showing
17 changed files
with
653 additions
and
154 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
[package] | ||
description = "An example and template runtime built with Tuxedo." | ||
edition = "2021" | ||
license = "Apache-2.0" | ||
name = "tuxedo-parachain-runtime" | ||
repository = "https://github.com/Off-Narative-Labs/Tuxedo" | ||
version = "1.0.0-dev" | ||
|
||
[dependencies] | ||
log = { workspace = true } | ||
parity-scale-codec = { features = [ "derive" ], workspace = true } | ||
parity-util-mem = { optional = true, workspace = true } | ||
scale-info = { features = [ "derive", "serde" ], workspace = true } | ||
serde = { features = [ "derive" ], workspace = true } | ||
|
||
sp-api = { default_features = false, workspace = true } | ||
sp-block-builder = { default_features = false, workspace = true } | ||
sp-core = { features = [ "serde" ], default_features = false, workspace = true } | ||
sp-debug-derive = { features = [ "force-debug" ], default_features = false, workspace = true } | ||
sp-inherents = { default_features = false, workspace = true } | ||
sp-io = { features = [ "with-tracing" ], default_features = false, workspace = true } | ||
sp-runtime = { features = [ "serde" ], default_features = false, workspace = true } | ||
sp-session = { default_features = false, workspace = true } | ||
sp-std = { default_features = false, workspace = true } | ||
sp-storage = { default_features = false, workspace = true } | ||
sp-timestamp = { default_features = false, workspace = true } | ||
sp-transaction-pool = { default_features = false, workspace = true } | ||
sp-version = { default_features = false, workspace = true } | ||
|
||
# The inner runtime | ||
inner-runtime = { default-features = false, package = "tuxedo-template-runtime", path = "../tuxedo-template-runtime" } | ||
|
||
# These were added for Aura / Grandpa API support | ||
hex-literal = { workspace = true } | ||
sp-application-crypto = { default_features = false, workspace = true } | ||
sp-consensus-aura = { default_features = false, workspace = true } | ||
sp-consensus-grandpa = { default_features = false, workspace = true } | ||
|
||
# Parachain related ones | ||
cumulus-primitives-core = { default-features = false, workspace = true } | ||
parachain-piece = { default-features = false, path = "../wardrobe/parachain" } | ||
tuxedo-parachain-core = { default-features = false, path = "../tuxedo-parachain-core" } | ||
|
||
[build-dependencies] | ||
substrate-wasm-builder = { workspace = true } | ||
|
||
[features] | ||
default = [ "std" ] | ||
std = [ | ||
"sp-debug-derive/std", | ||
"sp-block-builder/std", | ||
"sp-inherents/std", | ||
"parity-scale-codec/std", | ||
"sp-core/std", | ||
"sp-std/std", | ||
"serde/std", | ||
"sp-api/std", | ||
"sp-session/std", | ||
"sp-io/std", | ||
"sp-runtime/std", | ||
"sp-transaction-pool/std", | ||
"sp-version/std", | ||
"parity-util-mem", | ||
"sp-storage/std", | ||
"sp-consensus-aura/std", | ||
"sp-application-crypto/std", | ||
"sp-consensus-grandpa/std", | ||
"inner-runtime/std", | ||
"cumulus-primitives-core/std", | ||
"parachain-piece/std", | ||
"tuxedo-parachain-core/std", | ||
] |
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,13 @@ | ||
#[cfg(feature = "std")] | ||
fn main() { | ||
substrate_wasm_builder::WasmBuilder::new() | ||
.with_current_project() | ||
.export_heap_base() | ||
.import_memory() | ||
.build() | ||
} | ||
|
||
/// The wasm builder is deactivated when compiling | ||
/// this crate for wasm to speed up the compilation. | ||
#[cfg(not(feature = "std"))] | ||
fn main() {} |
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,51 @@ | ||
//! Helper module to build a genesis configuration for the template runtime. | ||
use super::{OuterConstraintChecker, OuterVerifier, WASM_BINARY}; | ||
use hex_literal::hex; | ||
use inner_runtime::{money::Coin, OuterConstraintChecker as InnerConstraintChecker}; | ||
use tuxedo_parachain_core::tuxedo_core::{ | ||
genesis::TuxedoGenesisConfig, | ||
verifier::{Sr25519Signature, ThresholdMultiSignature}, | ||
ConstraintChecker, | ||
}; | ||
|
||
/// Helper type for the ChainSpec. | ||
pub type RuntimeGenesisConfig = TuxedoGenesisConfig<OuterVerifier, OuterConstraintChecker>; | ||
|
||
const SHAWN_PUB_KEY_BYTES: [u8; 32] = | ||
hex!("d2bf4b844dfefd6772a8843e669f943408966a977e3ae2af1dd78e0f55f4df67"); | ||
const ANDREW_PUB_KEY_BYTES: [u8; 32] = | ||
hex!("baa81e58b1b4d053c2e86d93045765036f9d265c7dfe8b9693bbc2c0f048d93a"); | ||
|
||
pub fn development_genesis_config() -> RuntimeGenesisConfig { | ||
let signatories = vec![SHAWN_PUB_KEY_BYTES.into(), ANDREW_PUB_KEY_BYTES.into()]; | ||
|
||
let user_genesis_transactions = [ | ||
// Money Transactions | ||
Coin::<0>::mint::<_, _, InnerConstraintChecker>( | ||
100, | ||
Sr25519Signature::new(SHAWN_PUB_KEY_BYTES), | ||
) | ||
.transform(), | ||
Coin::<0>::mint::<_, _, InnerConstraintChecker>( | ||
100, | ||
ThresholdMultiSignature::new(1, signatories), | ||
) | ||
.transform(), | ||
// No Kitty or anything else in this one. Keep it simple. | ||
] | ||
.into_iter() | ||
.map(Into::into); | ||
|
||
// The inherents are computed using the appropriate method, and placed before the user transactions. | ||
// Ideally this will get better upstream eventually. | ||
let mut genesis_transactions = OuterConstraintChecker::genesis_transactions(); | ||
genesis_transactions.extend(user_genesis_transactions); | ||
|
||
RuntimeGenesisConfig::new( | ||
WASM_BINARY | ||
.expect("Runtime WASM binary must exist.") | ||
.to_vec(), | ||
genesis_transactions, | ||
) | ||
} |
Oops, something went wrong.