From 72a6f604989a76ab01b008b74a9151f3898e6026 Mon Sep 17 00:00:00 2001 From: Jaco Date: Fri, 1 Jul 2022 13:40:00 +0200 Subject: [PATCH] Runtime older offchain & txqueue, additional pow (#5012) --- packages/types/src/interfaces/definitions.ts | 1 + .../types/src/interfaces/offchain/runtime.ts | 15 ++++++++ .../types/src/interfaces/pow/definitions.ts | 15 ++++++++ packages/types/src/interfaces/pow/index.ts | 4 +++ packages/types/src/interfaces/pow/runtime.ts | 32 +++++++++++++++++ packages/types/src/interfaces/pow/types.ts | 4 +++ .../types/src/interfaces/txqueue/runtime.ts | 34 +++++++++++++++++++ packages/types/src/interfaces/types.ts | 1 + 8 files changed, 106 insertions(+) create mode 100644 packages/types/src/interfaces/pow/definitions.ts create mode 100644 packages/types/src/interfaces/pow/index.ts create mode 100644 packages/types/src/interfaces/pow/runtime.ts create mode 100644 packages/types/src/interfaces/pow/types.ts diff --git a/packages/types/src/interfaces/definitions.ts b/packages/types/src/interfaces/definitions.ts index 67c6a23c31..e9cec3d67e 100644 --- a/packages/types/src/interfaces/definitions.ts +++ b/packages/types/src/interfaces/definitions.ts @@ -30,6 +30,7 @@ export { default as imOnline } from './imOnline/definitions'; export { default as lottery } from './lottery/definitions'; export { default as mmr } from './mmr/definitions'; export { default as offences } from './offences/definitions'; +export { default as pow } from './pow/definitions'; export { default as proxy } from './proxy/definitions'; export { default as recovery } from './recovery/definitions'; export { default as scheduler } from './scheduler/definitions'; diff --git a/packages/types/src/interfaces/offchain/runtime.ts b/packages/types/src/interfaces/offchain/runtime.ts index b089bf93e5..51c7d5eae1 100644 --- a/packages/types/src/interfaces/offchain/runtime.ts +++ b/packages/types/src/interfaces/offchain/runtime.ts @@ -19,6 +19,21 @@ export const runtime: DefinitionsCall = { } }, version: 2 + }, + { + methods: { + offchain_worker: { + description: 'Starts the off-chain task for given block header.', + params: [ + { + name: 'number', + type: 'BlockNumber' + } + ], + type: 'Null' + } + }, + version: 1 } ] }; diff --git a/packages/types/src/interfaces/pow/definitions.ts b/packages/types/src/interfaces/pow/definitions.ts new file mode 100644 index 0000000000..cf1b866912 --- /dev/null +++ b/packages/types/src/interfaces/pow/definitions.ts @@ -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; diff --git a/packages/types/src/interfaces/pow/index.ts b/packages/types/src/interfaces/pow/index.ts new file mode 100644 index 0000000000..2d307291c3 --- /dev/null +++ b/packages/types/src/interfaces/pow/index.ts @@ -0,0 +1,4 @@ +// Auto-generated via `yarn polkadot-types-from-defs`, do not edit +/* eslint-disable */ + +export * from './types'; diff --git a/packages/types/src/interfaces/pow/runtime.ts b/packages/types/src/interfaces/pow/runtime.ts new file mode 100644 index 0000000000..1cb509fe6d --- /dev/null +++ b/packages/types/src/interfaces/pow/runtime.ts @@ -0,0 +1,32 @@ +// Copyright 2017-2022 @polkadot/types authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import type { DefinitionsCall } from '../../types'; + +export const runtime: DefinitionsCall = { + DifficultyApi: [ + { + methods: { + difficulty: { + description: 'Return the target difficulty of the next block.', + params: [], + // This is Difficulty in the original, however this is chain-specific + type: 'Raw' + } + }, + version: 1 + } + ], + TimestampApi: [ + { + methods: { + timestamp: { + description: 'API necessary for timestamp-based difficulty adjustment algorithms.', + params: [], + type: 'Moment' + } + }, + version: 1 + } + ] +}; diff --git a/packages/types/src/interfaces/pow/types.ts b/packages/types/src/interfaces/pow/types.ts new file mode 100644 index 0000000000..3de0277bd9 --- /dev/null +++ b/packages/types/src/interfaces/pow/types.ts @@ -0,0 +1,4 @@ +// Auto-generated via `yarn polkadot-types-from-defs`, do not edit +/* eslint-disable */ + +export type PHANTOM_POW = 'pow'; diff --git a/packages/types/src/interfaces/txqueue/runtime.ts b/packages/types/src/interfaces/txqueue/runtime.ts index b466bbf34d..1822e05c65 100644 --- a/packages/types/src/interfaces/txqueue/runtime.ts +++ b/packages/types/src/interfaces/txqueue/runtime.ts @@ -27,6 +27,40 @@ export const runtime: DefinitionsCall = { } }, version: 3 + }, + { + methods: { + validate_transaction: { + description: 'Validate the transaction.', + params: [ + { + name: 'source', + type: 'TransactionSource' + }, + { + name: 'tx', + type: 'Extrinsic' + } + ], + type: 'TransactionValidity' + } + }, + version: 2 + }, + { + methods: { + validate_transaction: { + description: 'Validate the transaction.', + params: [ + { + name: 'tx', + type: 'Extrinsic' + } + ], + type: 'TransactionValidity' + } + }, + version: 1 } ] }; diff --git a/packages/types/src/interfaces/types.ts b/packages/types/src/interfaces/types.ts index c3a9df897a..493b990080 100644 --- a/packages/types/src/interfaces/types.ts +++ b/packages/types/src/interfaces/types.ts @@ -44,6 +44,7 @@ export * from './ormlTokens/types'; export * from './parachains/types'; export * from './payment/types'; export * from './poll/types'; +export * from './pow/types'; export * from './proxy/types'; export * from './purchase/types'; export * from './recovery/types';