I'm working on pow consensus chain and want to fetch block author in a pallet. I'm following Academy-PoW repo for adding block author through InherentDataProvider. But here default is passed in-place of actual author:
How to add actual author instead of default?
I have tried this process also:
let author = frame_system::Pallet::<T>::digest()
.logs
.iter()
.filter_map(|s| s.as_pre_runtime())
.filter_map(|(id, mut data)|
// if id == POW_ENGINE_ID {
T::AccountId::decode(&mut data).ok()
// } else {
// None
// }
)
.next();
But I get author as None.
Can anyone please help to fetch the block author in a pallet?