From 3b8db2ed3d884471c6ff2b8c3847806613ded7d1 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Fri, 21 Jun 2019 16:49:20 +0200 Subject: [PATCH] Rename SessionKeys fields (#1046) * Rename SessionKeys fields * Shorten --- packages/api-derive/src/staking/info.ts | 2 +- packages/types/src/type/SessionKeys.ts | 23 +++++++++++------------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/packages/api-derive/src/staking/info.ts b/packages/api-derive/src/staking/info.ts index 54e9306323..f69e5cdbe2 100644 --- a/packages/api-derive/src/staking/info.ts +++ b/packages/api-derive/src/staking/info.ts @@ -75,7 +75,7 @@ function nextSessionId (_nextKeyFor: Option): AccountId | und // For substrate 2.x, nextKeyFor is SessionKeys/Keys, for 1.x it is SessionKey return nextKeyFor - ? (nextKeyFor as SessionKeys).sessionKey || nextKeyFor + ? (nextKeyFor as SessionKeys).auraKey || nextKeyFor : undefined; } diff --git a/packages/types/src/type/SessionKeys.ts b/packages/types/src/type/SessionKeys.ts index 0c758a63bd..a3d5da286d 100644 --- a/packages/types/src/type/SessionKeys.ts +++ b/packages/types/src/type/SessionKeys.ts @@ -3,7 +3,6 @@ // of the Apache-2.0 license. See the LICENSE file for details. import Struct from '../codec/Struct'; -import AuthorityId from './AuthorityId'; import SessionKey from './SessionKey'; /** @@ -14,22 +13,22 @@ import SessionKey from './SessionKey'; export default class SessionKeys extends Struct { constructor (value?: any) { super({ - authorityId: AuthorityId, - sessionKey: SessionKey + grandpaKey: SessionKey, + auraKey: SessionKey }, value); } - /** - * @description The Grandpa Authority - */ - get authorityId (): AuthorityId { - return this.get('authorityId') as AuthorityId; - } - /** * @description The Aura session */ - get sessionKey (): SessionKey { - return this.get('sessionKey') as SessionKey; + get auraKey (): SessionKey { + return this.get('auraKey') as SessionKey; + } + + /** + * @description The Grandpa Authority + */ + get grandpaKey (): SessionKey { + return this.get('grandpaKey') as SessionKey; } }