From e6d9d245cc325f92f047da9015b073fab46ce37d Mon Sep 17 00:00:00 2001 From: Yuanchao Sun Date: Thu, 1 Apr 2021 00:20:49 +0800 Subject: [PATCH] Expose key_owner(), so other pallets can look up validator ID by the session key. --- frame/session/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frame/session/src/lib.rs b/frame/session/src/lib.rs index e7b16808f7239..3255bc20af4c6 100644 --- a/frame/session/src/lib.rs +++ b/frame/session/src/lib.rs @@ -819,7 +819,8 @@ impl Module { >::insert(v, keys); } - fn key_owner(id: KeyTypeId, key_data: &[u8]) -> Option { + /// Query the owner of a session key by returning the owner's validator ID. + pub fn key_owner(id: KeyTypeId, key_data: &[u8]) -> Option { >::get((id, key_data)) }