im retreivingI'm retrieving the list of authorities from aura in the pallet like this:
let authorities = pallet_aura::Pallet::<T>::authorities();
this should return a Vec<T::AuthorityId>
which is supposedly the same as sp_core::sr25519::Public
since AuthorityId
in Aura is defined like that here, so iI did the following:
authorities.into_iter().map(|id| Public::from_h256(H256::from_slice(id.as_slice())));
imI'm doing it this way because for some reason in AuthorityId i dontAuthorityId
I don't have access to any method like sp_core::sr25519::Public
, (iI specifically need the verify method) which is why in the pallet it throws an error:
no method named `as_slice` found for associated type `<T as pallet_aura::Config>::AuthorityId` in the current scope
now, having said that, in outer node if iI call the runtime api authorities()authorities()
and iI try to create sr25519 keys from it, it works:
let authorities= client
.runtime_api()
.authorities(&block_id)
.expect("error");
authorities
.iter()
.map(|pubkey| Public::from_h256(H256::from_slice(pubkey.as_slice())))
.collect()
- why is this happening, even though its completely the same function, im stuck with I
AuthorityIdm stuck with
AuthorityId` which has literally zero methods? and are there simpler ways to retreiveretrieve the Public keys of the current authorities that does not require all this mess?
Ps: iI tried importing the trait use sp_core::ByteArray;
but it still didn't work.