Swap Keys to "Opaque" tuple definitions (#1281)
This commit is contained in:
@@ -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'
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user