Bump dev (#1344)
This commit is contained in:
@@ -34,7 +34,7 @@ describe('Date', (): void => {
|
||||
testEncode('toNumber', 421);
|
||||
testEncode('toU8a', Uint8Array.from([165, 1, 0, 0, 0, 0, 0, 0]));
|
||||
|
||||
it(`can encode toString`, (): void => {
|
||||
it('can encode toString', (): void => {
|
||||
expect(
|
||||
new CodecDate(421)
|
||||
.toString()
|
||||
|
||||
@@ -107,7 +107,7 @@ export default class U8a extends Uint8Array implements Codec {
|
||||
* @description Returns the base runtime type name for this instance
|
||||
*/
|
||||
public toRawType (): string {
|
||||
return `&[u8]`;
|
||||
return '&[u8]';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,7 +17,7 @@ describe('StorageKey', (): void => {
|
||||
describe('with MetadataV3 (uses xxHash by default)', (): void => {
|
||||
const storage = fromMetadata(new Metadata(rpcDataV3));
|
||||
|
||||
it(`should correctly get Alice's freeBalance storage key (hex)`, (): void => {
|
||||
it('should correctly get Alice\'s freeBalance storage key (hex)', (): void => {
|
||||
expect(
|
||||
new StorageKey(
|
||||
storage
|
||||
@@ -28,7 +28,7 @@ describe('StorageKey', (): void => {
|
||||
).toBe('0xc99f5446efa57788f39ab529311f4550'); // FIXME OK this should be length-prefixed in reality
|
||||
});
|
||||
|
||||
it(`should correctly get Alice's freeBalance storage key (u8a)`, (): void => {
|
||||
it('should correctly get Alice\'s freeBalance storage key (u8a)', (): void => {
|
||||
expect(
|
||||
new StorageKey(
|
||||
storage
|
||||
@@ -46,7 +46,7 @@ describe('StorageKey', (): void => {
|
||||
describe('with MetadataV4 (uses xxHash by default)', (): void => {
|
||||
const storage = fromMetadata(new Metadata(rpcDataV4));
|
||||
|
||||
it(`should correctly get Alice's freeBalance storage key (hex)`, (): void => {
|
||||
it('should correctly get Alice\'s freeBalance storage key (hex)', (): void => {
|
||||
expect(
|
||||
new StorageKey(
|
||||
storage
|
||||
@@ -57,7 +57,7 @@ describe('StorageKey', (): void => {
|
||||
).toBe('0x7f864e18e3dd8b58386310d2fe0919eef27c6e558564b7f67f22d99d20f587bb');
|
||||
});
|
||||
|
||||
it(`should correctly get Alice's freeBalance storage key (u8a)`, (): void => {
|
||||
it('should correctly get Alice\'s freeBalance storage key (u8a)', (): void => {
|
||||
expect(
|
||||
new StorageKey(
|
||||
storage
|
||||
@@ -73,7 +73,7 @@ describe('StorageKey', (): void => {
|
||||
);
|
||||
});
|
||||
|
||||
it(`should correctly get the EventTopics double map storage key (hex)`, (): void => {
|
||||
it('should correctly get the EventTopics double map storage key (hex)', (): void => {
|
||||
expect(
|
||||
new StorageKey([
|
||||
storage
|
||||
@@ -85,7 +85,7 @@ describe('StorageKey', (): void => {
|
||||
).toBe('0x3007c9ff7027f65900abcdfca4fdb107ead47e2a9e3558e01b691b0f4a5f8518d487326614f066416308bf6aa4e5041d1949928e4b26ede98e3cebb36a3b1726');
|
||||
});
|
||||
|
||||
it(`should correctly get the EventTopics double map storage key (u8a)`, (): void => {
|
||||
it('should correctly get the EventTopics double map storage key (u8a)', (): void => {
|
||||
expect(
|
||||
new StorageKey([
|
||||
storage
|
||||
@@ -101,7 +101,7 @@ describe('StorageKey', (): void => {
|
||||
describe('with MetadataV5', (): void => {
|
||||
const storage = fromMetadata(new Metadata(rpcDataV5));
|
||||
|
||||
it(`should correctly get the EventTopics double map storage key (hex)`, (): void => {
|
||||
it('should correctly get the EventTopics double map storage key (hex)', (): void => {
|
||||
expect(
|
||||
new StorageKey([
|
||||
storage
|
||||
@@ -113,7 +113,7 @@ describe('StorageKey', (): void => {
|
||||
).toBe('0x3007c9ff7027f65900abcdfca4fdb107ead47e2a9e3558e01b691b0f4a5f8518d487326614f066416308bf6aa4e5041d1949928e4b26ede98e3cebb36a3b1726');
|
||||
});
|
||||
|
||||
it(`should correctly get the EventTopics double map storage key (u8a)`, (): void => {
|
||||
it('should correctly get the EventTopics double map storage key (u8a)', (): void => {
|
||||
expect(
|
||||
new StorageKey([
|
||||
storage
|
||||
@@ -129,7 +129,7 @@ describe('StorageKey', (): void => {
|
||||
describe('with MetadataV6', (): void => {
|
||||
const storage = fromMetadata(new Metadata(rpcDataV6));
|
||||
|
||||
it(`should correctly get the EventTopics double map storage key (hex)`, (): void => {
|
||||
it('should correctly get the EventTopics double map storage key (hex)', (): void => {
|
||||
expect(
|
||||
new StorageKey([
|
||||
storage
|
||||
@@ -141,7 +141,7 @@ describe('StorageKey', (): void => {
|
||||
).toBe('0x3007c9ff7027f65900abcdfca4fdb107ead47e2a9e3558e01b691b0f4a5f8518d487326614f066416308bf6aa4e5041d1949928e4b26ede98e3cebb36a3b1726');
|
||||
});
|
||||
|
||||
it(`should correctly get the EventTopics double map storage key (u8a)`, (): void => {
|
||||
it('should correctly get the EventTopics double map storage key (u8a)', (): void => {
|
||||
expect(
|
||||
new StorageKey([
|
||||
storage
|
||||
@@ -157,7 +157,7 @@ describe('StorageKey', (): void => {
|
||||
describe('with MetadataV7', (): void => {
|
||||
const storage = fromMetadata(new Metadata(rpcDataV7));
|
||||
|
||||
it(`should correctly get the EventTopics double map storage key (hex)`, (): void => {
|
||||
it('should correctly get the EventTopics double map storage key (hex)', (): void => {
|
||||
expect(
|
||||
new StorageKey([
|
||||
storage
|
||||
@@ -169,7 +169,7 @@ describe('StorageKey', (): void => {
|
||||
).toBe('0x3007c9ff7027f65900abcdfca4fdb107ead47e2a9e3558e01b691b0f4a5f8518d487326614f066416308bf6aa4e5041d1949928e4b26ede98e3cebb36a3b1726');
|
||||
});
|
||||
|
||||
it(`should correctly get the EventTopics double map storage key (u8a)`, (): void => {
|
||||
it('should correctly get the EventTopics double map storage key (u8a)', (): void => {
|
||||
expect(
|
||||
new StorageKey([
|
||||
storage
|
||||
|
||||
@@ -52,7 +52,7 @@ function addRpc (): string {
|
||||
const renderMethod = `${md}\n▸ **${methodName}**(${args})`;
|
||||
const renderReturnType = `: ${type}`;
|
||||
const renderSignature = `${renderMethod}${renderReturnType}`;
|
||||
const renderSummary = `${method && method.description ? `\n- **summary**: ${method.description}\n` : `\n\n`}`;
|
||||
const renderSummary = `${method && method.description ? `\n- **summary**: ${method.description}\n` : '\n\n'}`;
|
||||
|
||||
return `${renderSignature}${renderSummary}`;
|
||||
}, renderSection);
|
||||
|
||||
@@ -361,7 +361,7 @@ function generateTsDef (defName: string, { types }: { types: Record<string, any>
|
||||
});
|
||||
|
||||
fs.writeFileSync(`packages/types/src/interfaces/${defName}/types.ts`, header.concat(sortedDefs).concat(FOOTER), { flag: 'w' });
|
||||
fs.writeFileSync(`packages/types/src/interfaces/${defName}/index.ts`, HEADER.concat(`export * from './types';`).concat(FOOTER), { flag: 'w' });
|
||||
fs.writeFileSync(`packages/types/src/interfaces/${defName}/index.ts`, HEADER.concat('export * from \'./types\';').concat(FOOTER), { flag: 'w' });
|
||||
}
|
||||
|
||||
// Generate `packages/types/src/interfaceRegistry.ts`, the registry of all interfaces
|
||||
@@ -411,7 +411,7 @@ function generateInterfaceRegistry (): void {
|
||||
const interfaceEnd = '\n}';
|
||||
|
||||
fs.writeFileSync(
|
||||
`packages/types/src/interfaceRegistry.ts`,
|
||||
'packages/types/src/interfaceRegistry.ts',
|
||||
header.concat(interfaceStart).concat(primitives).concat(srml).concat(interfaceEnd).concat(FOOTER)
|
||||
, { flag: 'w' }
|
||||
);
|
||||
@@ -472,9 +472,9 @@ function generateRpcTypes (): void {
|
||||
// FIXME These 2 are too hard to type, I give up
|
||||
if (method.method === 'getStorage') {
|
||||
setImports(imports, ['Codec']);
|
||||
return ` getStorage<T = Codec>(key: any, block?: Hash | Uint8Array | string): Observable<T>;`;
|
||||
return ' getStorage<T = Codec>(key: any, block?: Hash | Uint8Array | string): Observable<T>;';
|
||||
} else if (method.method === 'subscribeStorage') {
|
||||
return ` subscribeStorage<T = Codec[]>(keys: any[]): Observable<T>;`;
|
||||
return ' subscribeStorage<T = Codec[]>(keys: any[]): Observable<T>;';
|
||||
}
|
||||
|
||||
const args = method.params.map((param): string => {
|
||||
@@ -491,7 +491,7 @@ function generateRpcTypes (): void {
|
||||
[
|
||||
` ${section}: {`,
|
||||
...allMethods,
|
||||
` };`
|
||||
' };'
|
||||
].join('\n')
|
||||
);
|
||||
}, []).join('\n');
|
||||
@@ -522,7 +522,7 @@ function generateRpcTypes (): void {
|
||||
const interfaceEnd = '\n}';
|
||||
|
||||
fs.writeFileSync(
|
||||
`packages/rpc-core/src/jsonrpc.types.ts`,
|
||||
'packages/rpc-core/src/jsonrpc.types.ts',
|
||||
header.concat(interfaceStart).concat(body).concat(interfaceEnd).concat(FOOTER)
|
||||
, { flag: 'w' }
|
||||
);
|
||||
@@ -535,16 +535,16 @@ function main (): void {
|
||||
generateTsDef(defName, obj);
|
||||
});
|
||||
|
||||
console.log(`Writing interfaces/types.ts`);
|
||||
console.log('Writing interfaces/types.ts');
|
||||
|
||||
fs.writeFileSync(`packages/types/src/interfaces/types.ts`, HEADER.concat(Object.keys(definitions).map((moduleName): string => `export * from './${moduleName}/types';`).join('\n')).concat(FOOTER), { flag: 'w' });
|
||||
fs.writeFileSync(`packages/types/src/interfaces/index.ts`, HEADER.concat(`export * from './types';`).concat(FOOTER), { flag: 'w' });
|
||||
fs.writeFileSync('packages/types/src/interfaces/types.ts', HEADER.concat(Object.keys(definitions).map((moduleName): string => `export * from './${moduleName}/types';`).join('\n')).concat(FOOTER), { flag: 'w' });
|
||||
fs.writeFileSync('packages/types/src/interfaces/index.ts', HEADER.concat('export * from \'./types\';').concat(FOOTER), { flag: 'w' });
|
||||
|
||||
console.log(`Writing interfaceRegistry.ts`);
|
||||
console.log('Writing interfaceRegistry.ts');
|
||||
|
||||
generateInterfaceRegistry();
|
||||
|
||||
console.log(`Writing packages/rpc-core/jsonrpc.types.ts`);
|
||||
console.log('Writing packages/rpc-core/jsonrpc.types.ts');
|
||||
|
||||
generateRpcTypes();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user