diff --git a/operator/runtime/src/configs/mod.rs b/operator/runtime/src/configs/mod.rs index f61fe23f..c7a1b9b3 100644 --- a/operator/runtime/src/configs/mod.rs +++ b/operator/runtime/src/configs/mod.rs @@ -340,16 +340,18 @@ impl FeeCalculator for TransactionPaymentAsGasPrice { } } -pub struct FindAuthorAdapter; -impl FindAuthor for FindAuthorAdapter { +pub struct FindAuthorAdapter(core::marker::PhantomData); +impl FindAuthor for FindAuthorAdapter +where + T: frame_system::Config + pallet_session::Config, + ::ValidatorId: Into, +{ fn find_author<'a, I>(digests: I) -> Option where I: 'a + IntoIterator, { - if let Some(author) = Babe::find_author(digests) { - return Some(H160::from_slice(&author.encode()[0..20])); - } - None + pallet_session::FindAccountFromAuthorIndex::::find_author(digests) + .map(|author| author.into()) } } @@ -383,7 +385,7 @@ impl pallet_evm::Config for Runtime { type Runner = pallet_evm::runner::stack::Runner; type OnChargeTransaction = OnChargeEVMTransaction<()>; type OnCreate = (); - type FindAuthor = FindAuthorAdapter; + type FindAuthor = FindAuthorAdapter; type GasLimitPovSizeRatio = GasLimitPovSizeRatio; type GasLimitStorageGrowthRatio = (); type Timestamp = Timestamp;