From d5b405f8169d9cec6459df1f1d1cc71ca4676447 Mon Sep 17 00:00:00 2001 From: Joshy Orndorff Date: Tue, 10 Oct 2023 01:10:43 -0400 Subject: [PATCH] First block hack in create flow. It actually runs and imports blocks!!!! --- tuxedo-core/src/inherents.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tuxedo-core/src/inherents.rs b/tuxedo-core/src/inherents.rs index 30aa5192f..d497fbeb4 100644 --- a/tuxedo-core/src/inherents.rs +++ b/tuxedo-core/src/inherents.rs @@ -174,7 +174,12 @@ impl, T: TuxedoInherent> InherentInte panic!("Authoring a leaf inherent constraint checker, but multiple previous inherents were supplied.") } - //TODO actually, maybe this is where the first-block hack should go now. + // This is how the first block hack manifests in the core + // TODO remove this if statement once genesis inherents are supported. + if previous_inherents.is_empty() { + return Vec::new(); + } + let previous_inherent = previous_inherents.get(0).expect( "Authoring a leaf inherent constraint checker, but no previous inherent was supplied.", ).clone();