Expose key_owner(), so other pallets can look up validator ID by the (#8506)

session key.
This commit is contained in:
Yuanchao Sun
2021-04-01 05:48:12 +08:00
committed by GitHub
parent 484a630db9
commit 159e7d50bb
+2 -1
View File
@@ -819,7 +819,8 @@ impl<T: Config> Module<T> {
<NextKeys<T>>::insert(v, keys);
}
fn key_owner(id: KeyTypeId, key_data: &[u8]) -> Option<T::ValidatorId> {
/// Query the owner of a session key by returning the owner's validator ID.
pub fn key_owner(id: KeyTypeId, key_data: &[u8]) -> Option<T::ValidatorId> {
<KeyOwner<T>>::get((id, key_data))
}