Skip to content

Commit

Permalink
bump (#490)
Browse files Browse the repository at this point in the history
  • Loading branch information
ermalkaleci authored Oct 30, 2023
1 parent 1e4aac2 commit ffea05e
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 21 deletions.
2 changes: 1 addition & 1 deletion executor/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion executor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion executor/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/chopsticks/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@acala-network/chopsticks",
"version": "0.8.5-5",
"version": "0.8.5-6",
"author": "Acala Developers <[email protected]>",
"license": "Apache-2.0",
"bin": "./chopsticks.js",
Expand Down
6 changes: 2 additions & 4 deletions packages/chopsticks/src/plugins/dry-run/dry-run-preimage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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}`)
Expand Down
7 changes: 2 additions & 5 deletions packages/chopsticks/src/plugins/run-block/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@acala-network/chopsticks-core",
"version": "0.8.5-5",
"version": "0.8.5-6",
"author": "Acala Developers <[email protected]>",
"license": "Apache-2.0",
"scripts": {
Expand Down
7 changes: 2 additions & 5 deletions packages/core/src/blockchain/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions packages/core/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
2 changes: 1 addition & 1 deletion packages/db/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@acala-network/chopsticks-db",
"version": "0.8.5-5",
"version": "0.8.5-6",
"author": "Acala Developers <[email protected]>",
"license": "Apache-2.0",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/testing/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@acala-network/chopsticks-testing",
"version": "0.8.5-5",
"version": "0.8.5-6",
"author": "Acala Developers <[email protected]>",
"license": "Apache-2.0",
"scripts": {
Expand Down

0 comments on commit ffea05e

Please sign in to comment.