Extract all unsafe Substrate RPC checks (#5538)

This commit is contained in:
Jaco
2023-03-14 09:41:27 +02:00
committed by GitHub
parent 4c3b6a660e
commit 046f51daf6
8 changed files with 32 additions and 9 deletions
+6 -9
View File
@@ -161,19 +161,16 @@ function addRpc (_runtimeDesc: string, rpcMethods?: string[]): string {
return name + (isOptional ? '?' : '') + ': `' + type + '`';
}).join(', ');
const type = '`' + method.type + '`';
const item: SectionItem = {
container.items.push({
interface: '`' + `api.rpc.${sectionName}.${methodName}` + '`',
jsonrpc: '`' + jsonrpc + '`',
// link: jsonrpc,
name: `${methodName}(${args}): ${type}`,
...(method.description && { summary: method.description })
};
if (method.deprecated) {
item.deprecated = method.deprecated;
}
container.items.push(item);
...((method.description && { summary: method.description }) || {}),
...((method.deprecated && { deprecated: method.deprecated }) || {}),
...((method.isUnsafe && { unsafe: 'This method is only active with appropriate flags' }) || {})
});
});
return all;