Skip to content

Commit

Permalink
reuse existing transform method for wrapping transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshOrndorff committed Apr 2, 2024
1 parent 789d174 commit 1c72a85
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions tuxedo-parachain-runtime/src/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use hex_literal::hex;
use inner_runtime::{money::Coin, OuterConstraintChecker as InnerConstraintChecker};
use tuxedo_parachain_core::tuxedo_core::{
genesis::TuxedoGenesisConfig,
types::Transaction,
verifier::{Sr25519Signature, ThresholdMultiSignature},
ConstraintChecker,
};
Expand All @@ -22,15 +21,15 @@ 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
wrap_transaction(Coin::<0>::mint(
// Money Transactions
Coin::<0>::mint::<_, _, InnerConstraintChecker>(
100,
Sr25519Signature::new(SHAWN_PUB_KEY_BYTES),
)),
wrap_transaction(Coin::<0>::mint(
).transform(),
Coin::<0>::mint::<_, _, InnerConstraintChecker>(
100,
ThresholdMultiSignature::new(1, signatories),
)),
).transform(),
// No Kitty or anything else in this one. Keep it simple.
]
.into_iter()
Expand All @@ -48,15 +47,3 @@ pub fn development_genesis_config() -> RuntimeGenesisConfig {
genesis_transactions,
)
}

// TODO this part is ugly. We need to make this work better for the runtime dev eventually.
fn wrap_transaction<V>(
t: Transaction<V, InnerConstraintChecker>,
) -> Transaction<V, OuterConstraintChecker> {
Transaction {
inputs: t.inputs,
peeks: t.peeks,
outputs: t.outputs,
checker: OuterConstraintChecker::Inner(t.checker),
}
}

0 comments on commit 1c72a85

Please sign in to comment.