Make a start at the Polkadot launch types (#1700)

* Make a start at the Polkadot launch types

* Add missing old DispatchInfo
This commit is contained in:
Jaco Greeff
2020-01-08 09:21:23 +01:00
committed by GitHub
parent adffde368c
commit e855da1f13
3 changed files with 21 additions and 38 deletions
+11 -2
View File
@@ -13,11 +13,20 @@ interface VersionedType {
types: RegistryTypes;
}
// these are override types for polkadot chains
// these are override types for Polkadot & Kusama chains
// NOTE The SessionKeys definition for Polkadot and Substrate (OpaqueKeys
// implementation) are different. Detect Polkadot and inject the `Keys`
// definition as applicable. (4 keys in substrate vs 5 in Polkadot/CC3).
const TYPES_POLKADOT_VERSIONED: VersionedType[] = [
{
minmax: [1000, undefined], // from launch
types: {
Keys: 'SessionKeys5'
}
}
];
const TYPES_KUSAMA_VERSIONED: VersionedType[] = [
{
minmax: [1019, 1031], // CC3, from launch
types: {
@@ -55,7 +64,7 @@ const TYPES_META: VersionedType[] = [
// Type overrides for specific spec types & versions as given in runtimeVersion
const TYPES_SPEC: Record<string, VersionedType[]> = {
kusama: TYPES_POLKADOT_VERSIONED,
kusama: TYPES_KUSAMA_VERSIONED,
polkadot: TYPES_POLKADOT_VERSIONED
};
@@ -25,6 +25,10 @@ export default {
class: 'DispatchClass',
paysFee: 'bool'
},
DispatchInfoTo190: {
weight: 'Weight',
class: 'DispatchClass'
},
Extrinsic: 'GenericExtrinsic',
ExtrinsicEra: 'GenericExtrinsicEra',
ExtrinsicPayload: 'GenericExtrinsicPayload',