Add runtime decoration defaults (#4993)

* Add runtime decoration defaults

* Default exports

* Additional

* hash + version
This commit is contained in:
Jaco
2022-06-30 10:23:00 +03:00
committed by GitHub
parent 354c4b8fd4
commit abdbd37215
36 changed files with 352 additions and 41 deletions
@@ -17,7 +17,8 @@ export const runtime: DefinitionsCall = {
params: [],
type: 'SlotDuration'
}
}
},
version: 1
}
]
};
@@ -35,7 +35,7 @@ const V1_V2_SHARED: Record<string, DefinitionCall> = {
params: [],
type: 'Epoch'
}
// TDODO Add submit_report_equivocation_unsigned_extrinsic
// TODO Add submit_report_equivocation_unsigned_extrinsic
};
export const runtime: DefinitionsCall = {
@@ -36,6 +36,10 @@ export default {
BeefyPayload: 'Vec<(BeefyPayloadId, Bytes)>',
BeefyPayloadId: '[u8;2]',
MmrRootHash: 'H256',
ValidatorSetId: 'u64'
ValidatorSetId: 'u64',
ValidatorSet: {
validators: 'Vec<AuthorityId>',
id: 'ValidatorSetId'
}
}
} as Definitions;
+14 -1
View File
@@ -4,6 +4,18 @@
import type { DefinitionsCall } from '../../types';
export const runtime: DefinitionsCall = {
BeefyApi: [
{
methods: {
validator_set: {
description: 'Return the current active BEEFY validator set',
params: [],
type: 'Option<ValidatorSet>'
}
},
version: 1
}
],
BeefyMmrApi: [
{
methods: {
@@ -17,7 +29,8 @@ export const runtime: DefinitionsCall = {
params: [],
type: 'BeefyNextAuthoritySet'
}
}
},
version: 1
}
]
};
@@ -3,6 +3,7 @@
import type { Bytes, Option, Struct, U8aFixed, Vec, u32, u64 } from '@polkadot/types-codec';
import type { ITuple } from '@polkadot/types-codec/types';
import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
import type { EcdsaSignature } from '@polkadot/types/interfaces/extrinsics';
import type { BlockNumber, H256 } from '@polkadot/types/interfaces/runtime';
@@ -45,6 +46,12 @@ export interface BeefySignedCommitment extends Struct {
/** @name MmrRootHash */
export interface MmrRootHash extends H256 {}
/** @name ValidatorSet */
export interface ValidatorSet extends Struct {
readonly validators: Vec<AuthorityId>;
readonly id: ValidatorSetId;
}
/** @name ValidatorSetId */
export interface ValidatorSetId extends u64 {}
@@ -103,7 +103,8 @@ export const runtime: DefinitionsCall = {
],
type: 'CodeUploadResult'
}
}
},
version: 1
}
]
};
@@ -15,6 +15,7 @@ export { default as consensus } from './consensus/definitions';
export { default as contracts } from './contracts/definitions';
export { default as democracy } from './democracy/definitions';
export { default as dev } from './dev/definitions';
export { default as discovery } from './discovery/definitions';
export { default as elections } from './elections/definitions';
export { default as engine } from './engine/definitions';
export { default as evm } from './evm/definitions';
@@ -48,6 +49,7 @@ export { default as bridges } from './bridges/definitions';
export { default as claims } from './claims/definitions';
export { default as crowdloan } from './crowdloan/definitions';
export { default as cumulus } from './cumulus/definitions';
export { default as finality } from './finality/definitions';
export { default as parachains } from './parachains/definitions';
export { default as poll } from './poll/definitions';
export { default as purchase } from './purchase/definitions';
@@ -0,0 +1,15 @@
// Copyright 2017-2022 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
// order important in structs... :)
/* eslint-disable sort-keys */
import type { Definitions } from '../../types';
import { runtime } from './runtime';
export default {
rpc: {},
runtime,
types: {}
} as Definitions;
@@ -0,0 +1,4 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
export * from './types';
@@ -0,0 +1,19 @@
// Copyright 2017-2022 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { DefinitionsCall } from '../../types';
export const runtime: DefinitionsCall = {
AuthorityDiscoveryApi: [
{
methods: {
authorities: {
description: 'Retrieve authority identifiers of the current and next authority set.',
params: [],
type: 'Vec<AuthorityId>'
}
},
version: 1
}
]
};
@@ -0,0 +1,4 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
export type PHANTOM_DISCOVERY = 'discovery';
@@ -0,0 +1,15 @@
// Copyright 2017-2022 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
// order important in structs... :)
/* eslint-disable sort-keys */
import type { Definitions } from '../../types';
import { runtime } from './runtime';
export default {
rpc: {},
runtime,
types: {}
} as Definitions;
@@ -0,0 +1,4 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
export * from './types';
@@ -0,0 +1,23 @@
// Copyright 2017-2022 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { DefinitionsCall } from '../../types';
// implemented by chains bridging into the relay, not the relay itself
const finalityV1 = {
methods: {
best_finalized: {
description: 'Returns number and hash of the best finalized header known to the bridge module.',
params: [],
type: '(BlockNumber, Hash)'
}
},
version: 1
};
export const runtime: DefinitionsCall = {
KusamaFinalityApi: [finalityV1],
PolkadotFinalityApi: [finalityV1],
RococoFinalityApi: [finalityV1],
WestendFinalityApi: [finalityV1]
};
@@ -0,0 +1,4 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
export type PHANTOM_FINALITY = 'finality';
@@ -17,6 +17,7 @@ export const runtime: DefinitionsCall = {
params: [],
type: 'AuthorityList'
}
// TODO submit_report_equivocation_unsigned_extrinsic, generate_key_ownership_proof
},
version: 3
}
@@ -12,7 +12,8 @@ export const runtime: DefinitionsCall = {
params: [],
type: 'OpaqueMetadata'
}
}
},
version: 1
}
]
};
@@ -35,7 +35,8 @@ export const runtime: DefinitionsCall = {
],
type: 'RuntimeDispatchInfo'
}
}
},
version: 1
}
]
};
@@ -8,6 +8,8 @@ import type { Definitions } from '../../types';
import { objectSpread } from '@polkadot/util';
import { runtime } from './runtime';
const numberTypes = {
Fixed64: 'Int<64, Fixed64>',
FixedI64: 'Int<64, FixedI64>',
@@ -47,6 +49,7 @@ export const knownOrigins: Record<string, string> = {
export default {
rpc: {},
runtime,
types: objectSpread({}, numberTypes, {
AccountId: 'AccountId32',
AccountId20: 'GenericEthereumAccountId',
@@ -0,0 +1,20 @@
// Copyright 2017-2022 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { DefinitionsCall } from '../../types';
export const runtime: DefinitionsCall = {
Core: [
{
methods: {
version: {
description: 'Returns the version of the runtime.',
params: [],
type: 'RuntimeVersion'
}
},
version: 4
// TODO Add execute_block & initialize_block
}
]
};
@@ -27,7 +27,8 @@ export const runtime: DefinitionsCall = {
],
type: 'Bytes'
}
}
},
version: 1
}
]
};
@@ -17,7 +17,8 @@ export const runtime: DefinitionsCall = {
],
type: 'Index'
}
}
},
version: 1
}
]
};
+2
View File
@@ -21,11 +21,13 @@ export * from './crowdloan/types';
export * from './cumulus/types';
export * from './democracy/types';
export * from './dev/types';
export * from './discovery/types';
export * from './elections/types';
export * from './engine/types';
export * from './eth/types';
export * from './evm/types';
export * from './extrinsics/types';
export * from './finality/types';
export * from './genericAsset/types';
export * from './gilt/types';
export * from './grandpa/types';
+1 -1
View File
@@ -61,7 +61,7 @@ export type DefinitionsRpc = Record<string, DefinitionRpc | DefinitionRpcSub>;
export type DefinitionsCall = Record<string, {
methods: Record<string, DefinitionCall>;
version?: number;
version: number;
}[]>;
export type DefinitionsTypes = Record<string, DefinitionType>;