state_trieMigrationStatus RPC (#4664)
This commit is contained in:
+2
-1
@@ -5,7 +5,8 @@
|
||||
Changes:
|
||||
|
||||
- Support for rejection of hanging RPC requests (30s timeout)
|
||||
- Add `.stats()` to provider interfaces with running counters
|
||||
- Add `.stats` to provider interfaces with running counters
|
||||
- Add support for `state_trieMigrationStatus` RPC
|
||||
- Update to latest Substrate, Kusama & Polkadot static metadata
|
||||
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ export class HttpProvider implements ProviderInterface {
|
||||
/**
|
||||
* @description Returns the connection stats
|
||||
*/
|
||||
public stats (): ProviderStats {
|
||||
public get stats (): ProviderStats {
|
||||
return this.#stats;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,13 +51,13 @@ export type ProviderInterfaceEmitCb = (value?: any) => any;
|
||||
export interface ProviderInterface {
|
||||
readonly hasSubscriptions: boolean;
|
||||
readonly isConnected: boolean;
|
||||
readonly stats?: ProviderStats;
|
||||
|
||||
clone (): ProviderInterface;
|
||||
connect (): Promise<void>;
|
||||
disconnect (): Promise<void>;
|
||||
on (type: ProviderInterfaceEmitted, sub: ProviderInterfaceEmitCb): () => void;
|
||||
send <T = any> (method: string, params: unknown[], isCacheable?: boolean): Promise<T>;
|
||||
stats?: () => ProviderStats;
|
||||
subscribe (type: string, method: string, params: unknown[], cb: ProviderInterfaceCallback): Promise<number | string>;
|
||||
unsubscribe (type: string, method: string, id: number | string): Promise<boolean>;
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ export class WsProvider implements ProviderInterface {
|
||||
/**
|
||||
* @description Returns the connection stats
|
||||
*/
|
||||
public stats (): ProviderStats {
|
||||
public get stats (): ProviderStats {
|
||||
return {
|
||||
active: {
|
||||
requests: Object.keys(this.#handlers).length,
|
||||
|
||||
@@ -394,6 +394,18 @@ export default {
|
||||
}
|
||||
],
|
||||
type: 'TraceBlockResponse'
|
||||
},
|
||||
trieMigrationStatus: {
|
||||
description: 'Check current migration state',
|
||||
params: [
|
||||
{
|
||||
name: 'at',
|
||||
type: 'BlockHash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'MigrationStatusResult'
|
||||
}
|
||||
},
|
||||
types: {
|
||||
@@ -422,6 +434,10 @@ export default {
|
||||
wasm: 'bool'
|
||||
},
|
||||
KeyValueOption: '(StorageKey, Option<StorageData>)',
|
||||
MigrationStatusResult: {
|
||||
topRemainingToMigrate: 'u64',
|
||||
childRemainingToMigrate: 'u64'
|
||||
},
|
||||
ReadProof: {
|
||||
at: 'Hash',
|
||||
proof: 'Vec<Bytes>'
|
||||
|
||||
Reference in New Issue
Block a user