Swap Keys to "Opaque" tuple definitions (#1281)

This commit is contained in:
Jaco Greeff
2019-08-09 09:19:47 +02:00
committed by GitHub
parent 9c301551e0
commit 2e109ba2a5
4 changed files with 13 additions and 52 deletions
@@ -10,16 +10,9 @@ export default {
// Defined in `node/runtime/src/lib.rs` as follow
// impl_opaque_keys! {
// pub struct SessionKeys {
SessionKeysSubstrate: {
grandpa: 'AccountId', // aka GrandpaId
babe: 'AccountId', // aka BabeId
imOnline: 'AccountId' // aka ImOnlineId
},
SessionKeysPolkadot: {
grandpa: 'AccountId', // aka GrandpaId
babe: 'AccountId', // aka BabeId
imOnline: 'AccountId' // aka ImOnlineId
},
// Here we revert to tuples to keep the interfaces "opaque", as per the use
SessionKeysSubstrate: '(AccountId, AccountId, AccountId)', // Grandpa, Babe, ImOnline
SessionKeysPolkadot: '(AccountId, AccountId, AccountId)',
Keys: 'SessionKeysSubstrate'
}
};
+5 -19
View File
@@ -1,6 +1,6 @@
// Auto-generated via `yarn build:interfaces`, do not edit
import { Struct } from '../../codec';
import { Codec } from '../../types';
import { u32 } from '../../primitive';
import { AccountId } from '../runtime';
@@ -10,22 +10,8 @@ export type Keys = SessionKeysSubstrate;
/** u32 */
export type SessionIndex = u32;
/** Struct */
export interface SessionKeysPolkadot extends Struct {
/** AccountId */
readonly grandpa: AccountId;
/** AccountId */
readonly babe: AccountId;
/** AccountId */
readonly imOnline: AccountId;
}
/** [AccountId, AccountId, AccountId] & Codec */
export type SessionKeysPolkadot = [AccountId, AccountId, AccountId] & Codec;
/** Struct */
export interface SessionKeysSubstrate extends Struct {
/** AccountId */
readonly grandpa: AccountId;
/** AccountId */
readonly babe: AccountId;
/** AccountId */
readonly imOnline: AccountId;
}
/** [AccountId, AccountId, AccountId] & Codec */
export type SessionKeysSubstrate = [AccountId, AccountId, AccountId] & Codec;