Skip to content

Commit

Permalink
Explore Aura slot a little bit too. This will probably be removed bef…
Browse files Browse the repository at this point in the history
…ore we merge this PR.
  • Loading branch information
Joshy Orndorff committed Sep 27, 2023
1 parent e9f039b commit 9b86b72
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tuxedo-template-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ impl_runtime_apis! {
"🕰️🖴 In `inherent_extrinsics`."
);

// Extract the timestamp
let timestamp_millis: u64 = data
.get_data(&sp_timestamp::INHERENT_IDENTIFIER)
.expect("Inherent data should decode properly")
Expand Down Expand Up @@ -374,6 +375,31 @@ impl_runtime_apis! {
"🕰️🖴 Timestamp transaction is: \n{:#?}", timestamp_tx
);

// Extract the Aura slot (although we are not using it yet)
// Actually, I wonder how Aura is working so well without this inherent...
// Maybe we are failing to check something important and aura-related.

// I guess we can probably author in other peoples' slots...
// This could be an expert exercise for Substrate students. We launch a chain that doesn't
// check for the right author in each slot. Then start a chain, and author all the blocks,
// and challenge students to figure out the problem and fix it.

use sp_consensus_aura::Slot;

let slot: Slot = data
.get_data(&sp_consensus_aura::inherents::INHERENT_IDENTIFIER)
.unwrap()
.unwrap();

log::info!(
target: LOG_TARGET,
"🕰️🖴 Aura slot is: {:#?}", slot
);


// Return just the timestamp extrinsic for now.
// Later we will either handle Aura properly or switch to nimbus.
// Soon we will add the parachain inherent in here.
vec![timestamp_tx]
}

Expand Down

0 comments on commit 9b86b72

Please sign in to comment.