diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f60f6a4e6..9a92c3c3b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Changes: - Only explicitly support LSB on `BitVec` types - Change `toHuman` on `BitVec` to output default LSB - Add `bytes{Sent, Recv}` to provider stats +- Add support for `dev_getBlockStats` RPC ## 7.13.1 Mar 19, 2022 diff --git a/packages/types/src/interfaces/definitions.ts b/packages/types/src/interfaces/definitions.ts index a64daa610f..51e6b7608c 100644 --- a/packages/types/src/interfaces/definitions.ts +++ b/packages/types/src/interfaces/definitions.ts @@ -14,6 +14,7 @@ export { default as collective } from './collective/definitions'; 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 elections } from './elections/definitions'; export { default as engine } from './engine/definitions'; export { default as evm } from './evm/definitions'; diff --git a/packages/types/src/interfaces/dev/definitions.ts b/packages/types/src/interfaces/dev/definitions.ts new file mode 100644 index 0000000000..a41c71d6f3 --- /dev/null +++ b/packages/types/src/interfaces/dev/definitions.ts @@ -0,0 +1,31 @@ +// 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'; + +export default { + rpc: { + getBlockStats: { + description: 'Reexecute the specified `block_hash` and gather statistics while doing so', + params: [ + { + name: 'at', + type: 'Hash', + isHistoric: true + } + ], + type: 'Option' + } + }, + types: { + BlockStats: { + witnessLen: 'u64', + witnessCompactLen: 'u64', + blockLen: 'u64', + blockNumExtrinsics: 'u64' + } + } +} as Definitions;