From ffea05eba8367a7d459f406e5c199af5e4408068 Mon Sep 17 00:00:00 2001 From: Ermal Kaleci Date: Mon, 30 Oct 2023 14:02:36 +0100 Subject: [PATCH] bump (#490) --- executor/Cargo.lock | 2 +- executor/Cargo.toml | 2 +- executor/package.json | 2 +- packages/chopsticks/package.json | 2 +- .../chopsticks/src/plugins/dry-run/dry-run-preimage.ts | 6 ++---- packages/chopsticks/src/plugins/run-block/index.ts | 7 ++----- packages/core/package.json | 2 +- packages/core/src/blockchain/block.ts | 7 ++----- packages/core/src/utils/index.ts | 10 ++++++++++ packages/db/package.json | 2 +- packages/testing/package.json | 2 +- 11 files changed, 23 insertions(+), 21 deletions(-) diff --git a/executor/Cargo.lock b/executor/Cargo.lock index 346f8f17..a407056e 100644 --- a/executor/Cargo.lock +++ b/executor/Cargo.lock @@ -162,7 +162,7 @@ dependencies = [ [[package]] name = "chopsticks-executor" -version = "0.8.5-5" +version = "0.8.5-6" dependencies = [ "arrayvec 0.7.4", "console_error_panic_hook", diff --git a/executor/Cargo.toml b/executor/Cargo.toml index e901e2f6..89dcc540 100644 --- a/executor/Cargo.toml +++ b/executor/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chopsticks-executor" -version = "0.8.5-5" +version = "0.8.5-6" description = "Chopsticks executor" repository = "https://github.com/AcalaNetwork/chopsticks" license = "Apache-2.0" diff --git a/executor/package.json b/executor/package.json index 68f6381b..62ee65c9 100644 --- a/executor/package.json +++ b/executor/package.json @@ -1,7 +1,7 @@ { "name": "@acala-network/chopsticks-executor", "description": "Chopsticks executor", - "version": "0.8.5-5", + "version": "0.8.5-6", "license": "Apache-2.0", "repository": { "type": "git", diff --git a/packages/chopsticks/package.json b/packages/chopsticks/package.json index 57130f2c..2478c9cb 100644 --- a/packages/chopsticks/package.json +++ b/packages/chopsticks/package.json @@ -1,6 +1,6 @@ { "name": "@acala-network/chopsticks", - "version": "0.8.5-5", + "version": "0.8.5-6", "author": "Acala Developers ", "license": "Apache-2.0", "bin": "./chopsticks.js", diff --git a/packages/chopsticks/src/plugins/dry-run/dry-run-preimage.ts b/packages/chopsticks/src/plugins/dry-run/dry-run-preimage.ts index 56b27902..20bb0bbd 100644 --- a/packages/chopsticks/src/plugins/dry-run/dry-run-preimage.ts +++ b/packages/chopsticks/src/plugins/dry-run/dry-run-preimage.ts @@ -5,7 +5,7 @@ import { hexToU8a } from '@polkadot/util' import { Config } from '../../schema' import { defaultLogger } from '../../logger' import { generateHtmlDiffPreviewFile } from '../../utils/generate-html-diff' -import { newHeader, runTask, setStorage, taskHandler } from '@acala-network/chopsticks-core' +import { newHeader, printRuntimeLogs, runTask, setStorage, taskHandler } from '@acala-network/chopsticks-core' import { openHtml } from '../../utils/open-html' import { setupContext } from '../../context' @@ -85,9 +85,7 @@ export const dryRunPreimage = async (argv: Config) => { throw new Error(result.Error) } - for (const logs of result.Call.runtimeLogs) { - defaultLogger.info(`RuntimeLogs:\n${logs}`) - } + printRuntimeLogs(result.Call.runtimeLogs) const filePath = await generateHtmlDiffPreviewFile(block, result.Call.storageDiff, hash) console.log(`Generated preview ${filePath}`) diff --git a/packages/chopsticks/src/plugins/run-block/index.ts b/packages/chopsticks/src/plugins/run-block/index.ts index dabb4449..1810f8b0 100644 --- a/packages/chopsticks/src/plugins/run-block/index.ts +++ b/packages/chopsticks/src/plugins/run-block/index.ts @@ -6,10 +6,9 @@ import { z } from 'zod' import _ from 'lodash' import type yargs from 'yargs' -import { Block, Context, decodeKeyValue, runTask, taskHandler } from '@acala-network/chopsticks-core' +import { Block, Context, decodeKeyValue, printRuntimeLogs, runTask, taskHandler } from '@acala-network/chopsticks-core' import { Config } from '../../schema' -import { defaultLogger } from '../../logger' import { defaultOptions, mockOptions } from '../../cli-options' import { generateHtmlDiffPreviewFile } from '../../utils/generate-html-diff' import { openHtml } from '../../utils/open-html' @@ -66,9 +65,7 @@ export const cli = (y: yargs.Argv) => { throw new Error(result.Error) } - for (const logs of result.Call.runtimeLogs) { - defaultLogger.info(`RuntimeLogs:\n${logs}`) - } + printRuntimeLogs(result.Call.runtimeLogs) if (argv.html) { const filePath = await generateHtmlDiffPreviewFile(parent, result.Call.storageDiff, block.hash) diff --git a/packages/core/package.json b/packages/core/package.json index d2126db0..59475134 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@acala-network/chopsticks-core", - "version": "0.8.5-5", + "version": "0.8.5-6", "author": "Acala Developers ", "license": "Apache-2.0", "scripts": { diff --git a/packages/core/src/blockchain/block.ts b/packages/core/src/blockchain/block.ts index fd286e8d..1f1151fa 100644 --- a/packages/core/src/blockchain/block.ts +++ b/packages/core/src/blockchain/block.ts @@ -10,8 +10,7 @@ import type { HexString } from '@polkadot/util/types' import { Blockchain } from '.' import { RemoteStorageLayer, StorageLayer, StorageLayerProvider, StorageValue, StorageValueKind } from './storage-layer' -import { compactHex } from '../utils' -import { defaultLogger } from '../logger' +import { compactHex, printRuntimeLogs } from '../utils' import { getRuntimeVersion, runTask, taskHandler } from '../wasm-executor' import type { RuntimeVersion } from '../wasm-executor' @@ -322,9 +321,7 @@ export class Block { taskHandler(this), ) if ('Call' in response) { - for (const log of response.Call.runtimeLogs) { - defaultLogger.info(`RuntimeLogs:\n${log}`) - } + printRuntimeLogs(response.Call.runtimeLogs) if (this.chain.offchainWorker) { // apply offchain storage diff --git a/packages/core/src/utils/index.ts b/packages/core/src/utils/index.ts index 847bde0d..e7245ca8 100644 --- a/packages/core/src/utils/index.ts +++ b/packages/core/src/utils/index.ts @@ -107,3 +107,13 @@ export const stripChildPrefix = (key: HexString) => { if (!child) return key return storageKey } + +export const printRuntimeLogs = (logs: string[]) => { + if (!logs.length) return + + console.group('RuntimeLogs:') + for (const log of logs) { + console.log(log) + } + console.groupEnd() +} diff --git a/packages/db/package.json b/packages/db/package.json index 181bb8fc..f26b134c 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -1,6 +1,6 @@ { "name": "@acala-network/chopsticks-db", - "version": "0.8.5-5", + "version": "0.8.5-6", "author": "Acala Developers ", "license": "Apache-2.0", "scripts": { diff --git a/packages/testing/package.json b/packages/testing/package.json index 9b0a88a2..b9bad2bf 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -1,6 +1,6 @@ { "name": "@acala-network/chopsticks-testing", - "version": "0.8.5-5", + "version": "0.8.5-6", "author": "Acala Developers ", "license": "Apache-2.0", "scripts": {