From e9df54da1cb3ce20b0fb3f357e955764dd5afb22 Mon Sep 17 00:00:00 2001 From: Xiliang Chen Date: Thu, 13 Jul 2023 13:51:16 +1200 Subject: [PATCH] update deps (#335) * update deps * update deps --- package.json | 14 +- packages/chopsticks/package.json | 4 +- .../src/blockchain/block-builder.ts | 16 +- packages/chopsticks/src/blockchain/block.ts | 10 +- packages/chopsticks/src/blockchain/index.ts | 8 +- .../inherent/parachain/validation-data.ts | 14 +- packages/chopsticks/src/blockchain/txpool.ts | 2 +- packages/chopsticks/src/cli.ts | 20 +- packages/chopsticks/src/dry-run-preimage.ts | 4 +- packages/chopsticks/src/dry-run.ts | 2 +- packages/chopsticks/src/executor.test.ts | 8 +- packages/chopsticks/src/executor.ts | 15 +- packages/chopsticks/src/genesis-provider.ts | 17 +- packages/chopsticks/src/logger.ts | 2 +- packages/chopsticks/src/offchain.ts | 4 +- packages/chopsticks/src/rpc/dev/dry-run.ts | 8 +- packages/chopsticks/src/rpc/dev/index.ts | 2 +- packages/chopsticks/src/rpc/shared.ts | 2 +- .../chopsticks/src/rpc/substrate/state.ts | 2 +- packages/chopsticks/src/run-block.ts | 2 +- packages/chopsticks/src/server.ts | 6 +- packages/chopsticks/src/utils/decoder.ts | 2 +- .../src/utils/generate-html-diff.ts | 2 +- packages/chopsticks/src/utils/set-storage.ts | 2 +- packages/chopsticks/src/xcm/index.ts | 2 +- packages/chopsticks/src/xcm/upward.ts | 2 +- packages/chopsticks/template/diff.html | 2 +- packages/e2e/package.json | 2 +- packages/e2e/src/dev.test.ts | 8 +- packages/e2e/src/genesis-provider.test.ts | 2 +- packages/e2e/src/helper.ts | 2 +- packages/e2e/src/import-storage/index.test.ts | 4 +- packages/e2e/src/networks.ts | 4 +- packages/e2e/src/relaychain.test.ts | 6 +- packages/e2e/src/storage.test.ts | 8 +- packages/e2e/src/xcm.test.ts | 4 +- packages/testing/package.json | 2 +- packages/testing/src/check.ts | 4 +- yarn.lock | 1998 ++++++++++------- 39 files changed, 1270 insertions(+), 948 deletions(-) diff --git a/package.json b/package.json index dfdca989..b1695fa6 100644 --- a/package.json +++ b/package.json @@ -34,22 +34,22 @@ "*.{js,ts,css,md}": "prettier --write" }, "devDependencies": { - "@swc/core": "^1.3.67", - "@types/node": "^20.3.3", + "@swc/core": "^1.3.68", + "@types/node": "^20.4.2", "@types/prettier": "^2.7.3", - "@typescript-eslint/eslint-plugin": "^5.60.1", - "@typescript-eslint/parser": "^5.60.0", - "eslint": "^8.43.0", + "@typescript-eslint/eslint-plugin": "^6.0.0", + "@typescript-eslint/parser": "^6.0.0", + "eslint": "^8.44.0", "eslint-config-prettier": "^8.8.0", "eslint-import-resolver-typescript": "^3.5.5", "eslint-plugin-import": "^2.27.5", "eslint-plugin-sort-imports-es6-autofix": "^0.6.0", "husky": "^8.0.3", - "prettier": "^2.8.8", + "prettier": "^3.0.0", "typescript": "^5.1.6", "unplugin-swc": "^1.3.2", "vite-tsconfig-paths": "^4.2.0", - "vitest": "^0.32.2", + "vitest": "^0.33.0", "wasm-pack": "^0.12.1" }, "exports": { diff --git a/packages/chopsticks/package.json b/packages/chopsticks/package.json index 2381c303..c26ac2bf 100644 --- a/packages/chopsticks/package.json +++ b/packages/chopsticks/package.json @@ -23,7 +23,7 @@ "jsondiffpatch": "^0.4.1", "lodash": "^4.17.21", "pino": "^8.14.1", - "pino-pretty": "^10.0.0", + "pino-pretty": "^10.0.1", "reflect-metadata": "^0.1.13", "sqlite3": "^5.1.6", "typeorm": "^0.3.17", @@ -34,7 +34,7 @@ "devDependencies": { "@types/js-yaml": "^4.0.5", "@types/lodash": "^4.14.195", - "@types/node": "^20.3.3", + "@types/node": "^20.4.2", "@types/ws": "^8.5.5", "@types/yargs": "^17.0.24", "ts-node": "^10.9.1", diff --git a/packages/chopsticks/src/blockchain/block-builder.ts b/packages/chopsticks/src/blockchain/block-builder.ts index 4a560340..f8716d8b 100644 --- a/packages/chopsticks/src/blockchain/block-builder.ts +++ b/packages/chopsticks/src/blockchain/block-builder.ts @@ -146,7 +146,7 @@ export const buildBlock = async ( inherents: HexString[], extrinsics: HexString[], ump: Record, - onApplyExtrinsicError: (extrinsic: HexString, error: TransactionValidityError) => void + onApplyExtrinsicError: (extrinsic: HexString, error: TransactionValidityError) => void, ): Promise<[Block, HexString[]]> => { const registry = await head.registry const header = await newHeader(head) @@ -157,7 +157,7 @@ export const buildBlock = async ( extrinsicsCount: extrinsics.length, umpCount: Object.keys(ump).length, }, - `Try building block #${(head.number + 1).toLocaleString()}` + `Try building block #${(head.number + 1).toLocaleString()}`, ) let layer: StorageLayer | undefined @@ -278,7 +278,7 @@ export const buildBlock = async ( const storageDiff = await newBlock.storageDiff() logger.trace( Object.entries(storageDiff).map(([key, value]) => [key, truncate(value)]), - 'Final block' + 'Final block', ) const finalBlock = new Block(head.chain, newBlock.number, blockData.hash.toHex(), head, { header, @@ -295,7 +295,7 @@ export const buildBlock = async ( pendingExtrinsicsCount: pendingExtrinsics.length, ump: truncate(ump), }, - 'Block built' + 'Block built', ) return [finalBlock, pendingExtrinsics] @@ -304,7 +304,7 @@ export const buildBlock = async ( export const dryRunExtrinsic = async ( head: Block, inherents: HexString[], - extrinsic: HexString | { call: HexString; address: string } + extrinsic: HexString | { call: HexString; address: string }, ): Promise => { const registry = await head.registry const header = await newHeader(head) @@ -313,7 +313,7 @@ export const dryRunExtrinsic = async ( if (typeof extrinsic !== 'string') { if (!head.chain.mockSignatureHost) { throw new Error( - 'Cannot fake signature because mock signature host is not enabled. Start chain with `mockSignatureHost: true`' + 'Cannot fake signature because mock signature host is not enabled. Start chain with `mockSignatureHost: true`', ) } @@ -343,14 +343,14 @@ export const dryRunExtrinsic = async ( defaultLogger.info( { call: registry.createType('GenericExtrinsic', hexToU8a(extrinsic)).toHuman() }, - 'dry_run_extrinsic' + 'dry_run_extrinsic', ) return newBlock.call('BlockBuilder_apply_extrinsic', [extrinsic]) } export const dryRunInherents = async ( head: Block, - inherents: HexString[] + inherents: HexString[], ): Promise<[HexString, HexString | null][]> => { const header = await newHeader(head) const { layers } = await initNewBlock(head, header, inherents) diff --git a/packages/chopsticks/src/blockchain/block.ts b/packages/chopsticks/src/blockchain/block.ts index 6e1e74bc..24262042 100644 --- a/packages/chopsticks/src/blockchain/block.ts +++ b/packages/chopsticks/src/blockchain/block.ts @@ -47,7 +47,7 @@ export class Block { extrinsics: HexString[] storage?: StorageLayerProvider storageDiff?: Record - } + }, ) { this.#chain = chain this.#parentBlock = parentBlock @@ -78,7 +78,7 @@ export class Block { get header(): Header | Promise
{ if (!this.#header) { this.#header = Promise.all([this.registry, this.#chain.api.getHeader(this.hash)]).then(([registry, header]) => - registry.createType
('Header', header) + registry.createType
('Header', header), ) } return this.#header @@ -190,8 +190,8 @@ export class Block { objectSpread( {}, getSpecExtensions(registry, chain, version.specName), - this.#chain.api.signedExtensions - ) + this.#chain.api.signedExtensions, + ), ) return registry }) @@ -233,7 +233,7 @@ export class Block { allowUnresolvedImports: this.#chain.allowUnresolvedImports, runtimeLogLevel: this.#chain.runtimeLogLevel, }, - taskHandler(this) + taskHandler(this), ) if (response.Call) { for (const log of response.Call.runtimeLogs) { diff --git a/packages/chopsticks/src/blockchain/index.ts b/packages/chopsticks/src/blockchain/index.ts index 2be47df4..efbd13f0 100644 --- a/packages/chopsticks/src/blockchain/index.ts +++ b/packages/chopsticks/src/blockchain/index.ts @@ -156,7 +156,7 @@ export class Blockchain { number: block.number, hash: block.hash, }, - 'setHead' + 'setHead', ) this.#head = block this.#registerBlock(block) @@ -178,7 +178,7 @@ export class Blockchain { async validateExtrinsic( extrinsic: HexString, - source: '0x00' | '0x01' | '0x02' = '0x02' /** External */ + source: '0x00' | '0x01' | '0x02' = '0x02' /** External */, ): Promise { const args = u8aToHex(u8aConcat(source, extrinsic, this.head.hash)) const res = await this.head.call('TaggedTransactionQueue_validate_transaction', [args]) @@ -220,7 +220,7 @@ export class Blockchain { async dryRunExtrinsic( extrinsic: HexString | { call: HexString; address: string }, - at?: HexString + at?: HexString, ): Promise<{ outcome: ApplyExtrinsicResult; storageDiff: [HexString, HexString | null][] }> { await this.api.isReady const head = at ? await this.getBlock(at) : this.head @@ -241,7 +241,7 @@ export class Blockchain { async dryRunHrmp( hrmp: Record, - at?: HexString + at?: HexString, ): Promise<[HexString, HexString | null][]> { await this.api.isReady const head = at ? await this.getBlock(at) : this.head diff --git a/packages/chopsticks/src/blockchain/inherent/parachain/validation-data.ts b/packages/chopsticks/src/blockchain/inherent/parachain/validation-data.ts index 931b9fc1..82810960 100644 --- a/packages/chopsticks/src/blockchain/inherent/parachain/validation-data.ts +++ b/packages/chopsticks/src/blockchain/inherent/parachain/validation-data.ts @@ -97,7 +97,7 @@ export class SetValidationData implements CreateInherents { const decoded = await decodeProof( extrinsic.validationData.relayParentStorageRoot, [...Object.values(WELL_KNOWN_KEYS), dmqMqcHeadKey, hrmpIngressChannelIndexKey, hrmpEgressChannelIndexKey], - extrinsic.relayChainState.trieNodes + extrinsic.relayChainState.trieNodes, ) for (const key of Object.values(WELL_KNOWN_KEYS)) { @@ -115,9 +115,9 @@ export class SetValidationData implements CreateInherents { u8aConcat( meta.registry.createType('Hash', dmqMqcHeadHash).toU8a(), meta.registry.createType('BlockNumber', sentAt).toU8a(), - blake2AsU8a(meta.registry.createType('Bytes', msg).toU8a(), 256) + blake2AsU8a(meta.registry.createType('Bytes', msg).toU8a(), 256), ), - 256 + 256, ) downwardMessages.push({ @@ -155,7 +155,7 @@ export class SetValidationData implements CreateInherents { const decoded = await decodeProof( extrinsic.validationData.relayParentStorageRoot, [hrmpChannelKey], - extrinsic.relayChainState.trieNodes + extrinsic.relayChainState.trieNodes, ) const abridgedHrmpRaw = decoded[hrmpChannelKey] if (!abridgedHrmpRaw) throw new Error('Canoot find hrmp channels from validation data') @@ -172,9 +172,9 @@ export class SetValidationData implements CreateInherents { u8aConcat( meta.registry.createType('Hash', abridgedHrmp.mqcHead).toU8a(), meta.registry.createType('BlockNumber', sentAt).toU8a(), - blake2AsU8a(bytes.toU8a(), 256) + blake2AsU8a(bytes.toU8a(), 256), ), - 256 + 256, ) abridgedHrmp.msgCount = (abridgedHrmp.msgCount as number) + 1 abridgedHrmp.totalSize = (abridgedHrmp.totalSize as number) + bytes.length @@ -203,7 +203,7 @@ export class SetValidationData implements CreateInherents { const decoded = await decodeProof( extrinsic.validationData.relayParentStorageRoot, [hrmpChannelKey], - extrinsic.relayChainState.trieNodes + extrinsic.relayChainState.trieNodes, ) newEntries.push([hrmpChannelKey, decoded[hrmpChannelKey]]) } diff --git a/packages/chopsticks/src/blockchain/txpool.ts b/packages/chopsticks/src/blockchain/txpool.ts index 1eb2589f..23c6572f 100644 --- a/packages/chopsticks/src/blockchain/txpool.ts +++ b/packages/chopsticks/src/blockchain/txpool.ts @@ -230,7 +230,7 @@ export class TxPool { params.upwardMessages, (extrinsic, error) => { this.event.emit(APPLY_EXTRINSIC_ERROR, [extrinsic, error]) - } + }, ) for (const extrinsic of pendingExtrinsics) { this.#pool.push({ extrinsic, signer: await this.#getSigner(extrinsic) }) diff --git a/packages/chopsticks/src/cli.ts b/packages/chopsticks/src/cli.ts index 8a1c3f94..9387e683 100644 --- a/packages/chopsticks/src/cli.ts +++ b/packages/chopsticks/src/cli.ts @@ -1,10 +1,10 @@ import { HexString } from '@polkadot/util/types' import { basename, extname } from 'node:path' +import { config as dotenvConfig } from 'dotenv' import { hideBin } from 'yargs/helpers' import { readFileSync } from 'node:fs' import _ from 'lodash' import axios from 'axios' -import dotenv from 'dotenv' import yaml from 'js-yaml' import yargs from 'yargs' @@ -18,7 +18,7 @@ import { logger } from './rpc/shared' import { runBlock } from './run-block' import { tryRuntime } from './try-runtime' -dotenv.config() +dotenvConfig() const CONFIGS_BASE_URL = 'https://raw.githubusercontent.com/AcalaNetwork/chopsticks/master/configs/' @@ -120,7 +120,7 @@ yargs(hideBin(process.argv)) }), async (argv) => { await setupWithServer(await processArgv(argv)) - } + }, ) .command( 'run-block', @@ -142,7 +142,7 @@ yargs(hideBin(process.argv)) }), async (argv) => { await runBlock(await processArgv(argv)) - } + }, ) .command( 'try-runtime', @@ -168,7 +168,7 @@ yargs(hideBin(process.argv)) }), async (argv) => { await tryRuntime(await processArgv(argv)) - } + }, ) .command( 'dry-run', @@ -210,7 +210,7 @@ yargs(hideBin(process.argv)) } else { await dryRun(config) } - } + }, ) .command( 'decode-key ', @@ -229,18 +229,18 @@ yargs(hideBin(process.argv)) const { storage, decodedKey } = decodeKey( await context.chain.head.meta, context.chain.head, - argv.key as HexString + argv.key as HexString, ) if (storage && decodedKey) { console.log( `${storage.section}.${storage.method}`, - decodedKey.args.map((x) => JSON.stringify(x.toHuman())).join(', ') + decodedKey.args.map((x) => JSON.stringify(x.toHuman())).join(', '), ) } else { console.log('Unknown') } process.exit(0) - } + }, ) .command( 'xcm', @@ -278,7 +278,7 @@ yargs(hideBin(process.argv)) await connectVertical(relaychain, parachain) } } - } + }, ) .strict() .help() diff --git a/packages/chopsticks/src/dry-run-preimage.ts b/packages/chopsticks/src/dry-run-preimage.ts index fbebf662..035fbe9b 100644 --- a/packages/chopsticks/src/dry-run-preimage.ts +++ b/packages/chopsticks/src/dry-run-preimage.ts @@ -80,7 +80,7 @@ export const dryRunPreimage = async (argv: Config) => { allowUnresolvedImports: false, runtimeLogLevel: argv['runtime-log-level'] || 0, }, - taskHandler(block) + taskHandler(block), ) if (result.Error) { @@ -112,7 +112,7 @@ export const dryRunPreimage = async (argv: Config) => { const filePath = await generateHtmlDiffPreviewFile( context.chain.head, storageDiff, - blake2AsHex(argv['extrinsic'], 256) + blake2AsHex(argv['extrinsic'], 256), ) console.log(`Generated preview ${filePath}`) if (argv['open']) { diff --git a/packages/chopsticks/src/dry-run.ts b/packages/chopsticks/src/dry-run.ts index 569ab543..e39cc198 100644 --- a/packages/chopsticks/src/dry-run.ts +++ b/packages/chopsticks/src/dry-run.ts @@ -23,7 +23,7 @@ export const dryRun = async (argv: Config) => { const filePath = await generateHtmlDiffPreviewFile( context.chain.head, storageDiff, - blake2AsHex(argv['extrinsic'], 256) + blake2AsHex(argv['extrinsic'], 256), ) console.log(`Generated preview ${filePath}`) if (argv['open']) { diff --git a/packages/chopsticks/src/executor.test.ts b/packages/chopsticks/src/executor.test.ts index 43358487..7ff4d5d6 100644 --- a/packages/chopsticks/src/executor.test.ts +++ b/packages/chopsticks/src/executor.test.ts @@ -52,11 +52,11 @@ describe('wasm', () => { it.each([0, 1])('calculate state root', async (trie_version) => { const a = await calculateStateRoot( [['0x5301bf5ff0298f5c7b93a446709f8e885f772afdd0d8ba3d4d559a06f0742f12', '0x01']], - trie_version + trie_version, ) const b = await calculateStateRoot( [['0x5301bf5ff0298f5c7b93a446709f8e885f772afdd0d8ba3d4d559a06f0742f12', '0x02']], - trie_version + trie_version, ) expect(a).to.not.eq(b) }) @@ -118,7 +118,7 @@ describe('wasm', () => { const originalDecoded = await decodeProof( ROOT_TRIE_HASH, [headKey, upgradeKey, ingressChannelIndexKey, egressChannelIndexKey, ...Object.values(WELL_KNOWN_KEYS)], - NODES + NODES, ) expect(originalDecoded).toMatchSnapshot() expect(originalDecoded[upgradeKey]).toBeUndefined() @@ -137,7 +137,7 @@ describe('wasm', () => { const decoded = await decodeProof( trieRootHash, [headKey, upgradeKey, ingressChannelIndexKey, egressChannelIndexKey, ...Object.values(WELL_KNOWN_KEYS)], - nodes + nodes, ) expect(decoded).toMatchSnapshot() expect(decoded[upgradeKey]).toBe('0x01') diff --git a/packages/chopsticks/src/executor.ts b/packages/chopsticks/src/executor.ts index c7c8936b..18782862 100644 --- a/packages/chopsticks/src/executor.ts +++ b/packages/chopsticks/src/executor.ts @@ -40,17 +40,20 @@ export const getRuntimeVersion = async (code: HexString): Promise => { return calculate_state_root(entries, trie_version) } export const decodeProof = async (trieRootHash: HexString, keys: HexString[], nodes: HexString[]) => { const decoded: [HexString, HexString | null][] = await decode_proof(trieRootHash, keys, nodes) - return decoded.reduce((accum, [key, value]) => { - accum[key] = value - return accum - }, {} as Record) + return decoded.reduce( + (accum, [key, value]) => { + accum[key] = value + return accum + }, + {} as Record, + ) } export const createProof = async (nodes: HexString[], entries: [HexString, HexString | null][]) => { @@ -66,7 +69,7 @@ export const runTask = async ( allowUnresolvedImports: boolean runtimeLogLevel: number }, - callback: JsCallback = emptyTaskHandler + callback: JsCallback = emptyTaskHandler, ) => { logger.trace(truncate(task), 'taskRun') const response = await run_task(task, callback, process.env.RUST_LOG) diff --git a/packages/chopsticks/src/genesis-provider.ts b/packages/chopsticks/src/genesis-provider.ts index 7f6355af..0eb02d73 100644 --- a/packages/chopsticks/src/genesis-provider.ts +++ b/packages/chopsticks/src/genesis-provider.ts @@ -30,11 +30,14 @@ export class GenesisProvider implements ProviderInterface { constructor(genesis: Genesis) { this.#genesis = genesis this.#stateRoot = calculateStateRoot( - Object.entries(this.#genesis.genesis.raw.top).reduce((accu, item) => { - accu.push(item as any) - return accu - }, [] as [HexString, HexString][]), - 1 + Object.entries(this.#genesis.genesis.raw.top).reduce( + (accu, item) => { + accu.push(item as any) + return accu + }, + [] as [HexString, HexString][], + ), + 1, ) this.#eventemitter = new EventEmitter() @@ -157,7 +160,7 @@ export class GenesisProvider implements ProviderInterface { allowUnresolvedImports: true, runtimeLogLevel: 0, }, - this._jsCallback + this._jsCallback, ) } case 'chain_getHeader': @@ -180,7 +183,7 @@ export class GenesisProvider implements ProviderInterface { _type: string, _method: string, _params: unknown[], - _cb: ProviderInterfaceCallback + _cb: ProviderInterfaceCallback, ): Promise => { throw Error('unimplemented') } diff --git a/packages/chopsticks/src/logger.ts b/packages/chopsticks/src/logger.ts index 6db6d05a..e8e231e7 100644 --- a/packages/chopsticks/src/logger.ts +++ b/packages/chopsticks/src/logger.ts @@ -28,7 +28,7 @@ const innerTruncate = return val.map(innerTruncate(level + 1)) } return Object.fromEntries( - Object.entries(val.toJSON ? val.toJSON() : val).map(([k, v]) => [k, innerTruncate(level + 1)(v)]) + Object.entries(val.toJSON ? val.toJSON() : val).map(([k, v]) => [k, innerTruncate(level + 1)(v)]), ) default: return val diff --git a/packages/chopsticks/src/offchain.ts b/packages/chopsticks/src/offchain.ts index d15b08a4..95269a2d 100644 --- a/packages/chopsticks/src/offchain.ts +++ b/packages/chopsticks/src/offchain.ts @@ -19,7 +19,7 @@ export class OffchainWorker { async run(block: Block) { logger.info( { number: block.number, hash: block.hash }, - `Run Offchain Worker for block #${block.number.toLocaleString()}` + `Run Offchain Worker for block #${block.number.toLocaleString()}`, ) const header = await block.header @@ -35,7 +35,7 @@ export class OffchainWorker { await block.chain.txPool.buildBlock({ transactions }) }, 100, - txs + txs, ) } } diff --git a/packages/chopsticks/src/rpc/dev/dry-run.ts b/packages/chopsticks/src/rpc/dev/dry-run.ts index 92b5e95b..2921184d 100644 --- a/packages/chopsticks/src/rpc/dev/dry-run.ts +++ b/packages/chopsticks/src/rpc/dev/dry-run.ts @@ -18,7 +18,7 @@ const dryRunSchema = z.object({ z.object({ call: zHex, address: zHex, - }) + }), ) .optional(), hrmp: z @@ -29,9 +29,9 @@ const dryRunSchema = z.object({ z.object({ sentAt: z.number(), data: zHex, - }) + }), ) - .min(1) + .min(1), ) .optional(), dmp: z @@ -39,7 +39,7 @@ const dryRunSchema = z.object({ z.object({ sentAt: z.number(), msg: zHex, - }) + }), ) .min(1) .optional(), diff --git a/packages/chopsticks/src/rpc/dev/index.ts b/packages/chopsticks/src/rpc/dev/index.ts index 2069ab6c..50a89739 100644 --- a/packages/chopsticks/src/rpc/dev/index.ts +++ b/packages/chopsticks/src/rpc/dev/index.ts @@ -47,7 +47,7 @@ const handlers: Handlers = { hash, values, }, - 'dev_setStorage' + 'dev_setStorage', ) return hash }, diff --git a/packages/chopsticks/src/rpc/shared.ts b/packages/chopsticks/src/rpc/shared.ts index c987e290..ca6ba90d 100644 --- a/packages/chopsticks/src/rpc/shared.ts +++ b/packages/chopsticks/src/rpc/shared.ts @@ -32,6 +32,6 @@ export interface SubscriptionManager { export type Handler = ( context: Context, params: any[], - subscriptionManager: SubscriptionManager + subscriptionManager: SubscriptionManager, ) => Promise export type Handlers = Record diff --git a/packages/chopsticks/src/rpc/substrate/state.ts b/packages/chopsticks/src/rpc/substrate/state.ts index ed0ca590..1d6826b1 100644 --- a/packages/chopsticks/src/rpc/substrate/state.ts +++ b/packages/chopsticks/src/rpc/substrate/state.ts @@ -71,7 +71,7 @@ const handlers: Handlers = { (keys as string[]).map(async (key) => { const val = await context.chain.head.get(key) return [key, val] - }) + }), ) callback({ block: context.chain.head.hash, diff --git a/packages/chopsticks/src/run-block.ts b/packages/chopsticks/src/run-block.ts index 86ddacea..fac92776 100644 --- a/packages/chopsticks/src/run-block.ts +++ b/packages/chopsticks/src/run-block.ts @@ -33,7 +33,7 @@ export const runBlock = async (argv: Config) => { allowUnresolvedImports: false, runtimeLogLevel: argv['runtime-log-level'] || 0, }, - taskHandler(parent) + taskHandler(parent), ) if (result.Error) { diff --git a/packages/chopsticks/src/server.ts b/packages/chopsticks/src/server.ts index e50c36b1..56fa0835 100644 --- a/packages/chopsticks/src/server.ts +++ b/packages/chopsticks/src/server.ts @@ -7,7 +7,7 @@ const logger = defaultLogger.child({ name: 'ws' }) export type Handler = ( data: { method: string; params: string[] }, - subscriptionManager: SubscriptionManager + subscriptionManager: SubscriptionManager, ) => Promise const parseRequest = (request: string) => { @@ -122,7 +122,7 @@ export const createServer = async (handler: Handler, port?: number) => { id: req.id, method: req.method, }, - 'Received message' + 'Received message', ) try { @@ -133,7 +133,7 @@ export const createServer = async (handler: Handler, port?: number) => { method: req.method, result: truncate(resp), }, - 'Sending response for request' + 'Sending response for request', ) send({ id: req.id, diff --git a/packages/chopsticks/src/utils/decoder.ts b/packages/chopsticks/src/utils/decoder.ts index 62619888..ae6c7ee7 100644 --- a/packages/chopsticks/src/utils/decoder.ts +++ b/packages/chopsticks/src/utils/decoder.ts @@ -43,7 +43,7 @@ const getStorageEntry = (meta: DecoratedMeta, block: Block, key: HexString) => { export const decodeKey = ( meta: DecoratedMeta, block: Block, - key: HexString + key: HexString, ): { storage?: StorageEntry; decodedKey?: StorageKey } => { const storage = getStorageEntry(meta, block, key) const decodedKey = meta.registry.createType('StorageKey', key) diff --git a/packages/chopsticks/src/utils/generate-html-diff.ts b/packages/chopsticks/src/utils/generate-html-diff.ts index 8f061743..051d887e 100644 --- a/packages/chopsticks/src/utils/generate-html-diff.ts +++ b/packages/chopsticks/src/utils/generate-html-diff.ts @@ -14,7 +14,7 @@ export const generateHtmlDiff = async (block: Block, diff: [HexString, HexString export const generateHtmlDiffPreviewFile = async ( block: Block, diff: [HexString, HexString | null][], - filename: string + filename: string, ) => { const html = await generateHtmlDiff(block, diff) mkdirSync('./preview', { recursive: true }) diff --git a/packages/chopsticks/src/utils/set-storage.ts b/packages/chopsticks/src/utils/set-storage.ts index 4f028c96..af3fbe15 100644 --- a/packages/chopsticks/src/utils/set-storage.ts +++ b/packages/chopsticks/src/utils/set-storage.ts @@ -55,7 +55,7 @@ function objectToStorageItems(meta: DecoratedMeta, storage: StorageConfig): RawS export const setStorage = async ( chain: Blockchain, storage: StorageValues, - blockHash?: HexString + blockHash?: HexString, ): Promise => { const block = await chain.getBlock(blockHash) if (!block) throw Error(`Cannot find block ${blockHash || 'latest'}`) diff --git a/packages/chopsticks/src/xcm/index.ts b/packages/chopsticks/src/xcm/index.ts index be37133f..26302525 100644 --- a/packages/chopsticks/src/xcm/index.ts +++ b/packages/chopsticks/src/xcm/index.ts @@ -11,7 +11,7 @@ export const connectVertical = async (relaychain: Blockchain, parachain: Blockch await connectDownward(relaychain, parachain) await connectUpward(parachain, relaychain) logger.info( - `Connected relaychain '${await relaychain.api.getSystemChain()}' with parachain '${await parachain.api.getSystemChain()}'` + `Connected relaychain '${await relaychain.api.getSystemChain()}' with parachain '${await parachain.api.getSystemChain()}'`, ) } diff --git a/packages/chopsticks/src/xcm/upward.ts b/packages/chopsticks/src/xcm/upward.ts index 37042fd9..cb4a12fe 100644 --- a/packages/chopsticks/src/xcm/upward.ts +++ b/packages/chopsticks/src/xcm/upward.ts @@ -19,7 +19,7 @@ export const connectUpward = async (parachain: Blockchain, relaychain: Blockchai relaychain.submitUpwardMessages( paraId, - upwardMessages.map((x) => x.toHex()) + upwardMessages.map((x) => x.toHex()), ) }) } diff --git a/packages/chopsticks/template/diff.html b/packages/chopsticks/template/diff.html index a9e021cf..db2d358d 100644 --- a/packages/chopsticks/template/diff.html +++ b/packages/chopsticks/template/diff.html @@ -1,4 +1,4 @@ - +