@acala-network/chopsticks 1.0.2-2 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/cli.js +10 -11
- package/dist/cjs/context.d.ts +1 -1
- package/dist/cjs/context.js +4 -3
- package/dist/cjs/logger.js +1 -1
- package/dist/cjs/plugins/decode-key/cli.js +1 -1
- package/dist/cjs/plugins/dry-run/cli.js +2 -2
- package/dist/cjs/plugins/dry-run/dry-run-extrinsic.d.ts +1 -1
- package/dist/cjs/plugins/dry-run/dry-run-extrinsic.js +10 -10
- package/dist/cjs/plugins/dry-run/dry-run-preimage.d.ts +1 -1
- package/dist/cjs/plugins/dry-run/dry-run-preimage.js +11 -11
- package/dist/cjs/plugins/dry-run/index.d.ts +3 -3
- package/dist/cjs/plugins/dry-run/index.js +2 -2
- package/dist/cjs/plugins/dry-run/rpc.d.ts +1 -1
- package/dist/cjs/plugins/dry-run/rpc.js +1 -1
- package/dist/cjs/plugins/fetch-storage/cli.js +1 -1
- package/dist/cjs/plugins/follow-chain/cli.js +7 -7
- package/dist/cjs/plugins/index.d.ts +1 -1
- package/dist/cjs/plugins/index.js +2 -2
- package/dist/cjs/plugins/run-block/cli.js +2 -2
- package/dist/cjs/plugins/run-block/rpc.d.ts +2 -2
- package/dist/cjs/plugins/trace-transaction/index.d.ts +1 -1
- package/dist/cjs/plugins/trace-transaction/index.js +3 -3
- package/dist/cjs/plugins/trace-transaction/types.d.ts +2 -2
- package/dist/cjs/plugins/trace-transaction/utils.d.ts +3 -3
- package/dist/cjs/plugins/trace-transaction/utils.js +4 -4
- package/dist/cjs/plugins/try-runtime/index.js +5 -5
- package/dist/cjs/rpc/index.d.ts +1 -1
- package/dist/cjs/schema/index.d.ts +2 -2
- package/dist/cjs/schema/index.js +4 -4
- package/dist/cjs/server.d.ts +1 -1
- package/dist/cjs/server.js +3 -3
- package/dist/cjs/setup-with-server.d.ts +1 -1
- package/dist/cjs/setup-with-server.js +2 -2
- package/dist/cjs/utils/decoder.d.ts +2 -2
- package/dist/cjs/utils/fetch-storages-worker.js +1 -1
- package/dist/cjs/utils/fetch-storages.d.ts +1 -1
- package/dist/cjs/utils/fetch-storages.js +5 -5
- package/dist/cjs/utils/generate-html-diff.d.ts +2 -2
- package/dist/cjs/utils/generate-html-diff.js +1 -1
- package/dist/cjs/utils/open-html.js +2 -2
- package/dist/cjs/utils/override.d.ts +2 -2
- package/dist/cjs/utils/override.js +2 -2
- package/dist/esm/cli.js +5 -6
- package/dist/esm/context.d.ts +1 -1
- package/dist/esm/context.js +4 -3
- package/dist/esm/logger.js +1 -1
- package/dist/esm/plugins/decode-key/cli.js +1 -1
- package/dist/esm/plugins/dry-run/cli.js +2 -2
- package/dist/esm/plugins/dry-run/dry-run-extrinsic.d.ts +1 -1
- package/dist/esm/plugins/dry-run/dry-run-extrinsic.js +10 -10
- package/dist/esm/plugins/dry-run/dry-run-preimage.d.ts +1 -1
- package/dist/esm/plugins/dry-run/dry-run-preimage.js +11 -11
- package/dist/esm/plugins/dry-run/index.d.ts +3 -3
- package/dist/esm/plugins/dry-run/index.js +2 -2
- package/dist/esm/plugins/dry-run/rpc.d.ts +1 -1
- package/dist/esm/plugins/dry-run/rpc.js +1 -1
- package/dist/esm/plugins/fetch-storage/cli.js +1 -1
- package/dist/esm/plugins/follow-chain/cli.js +3 -3
- package/dist/esm/plugins/index.d.ts +1 -1
- package/dist/esm/plugins/index.js +2 -2
- package/dist/esm/plugins/run-block/cli.js +2 -2
- package/dist/esm/plugins/run-block/rpc.d.ts +2 -2
- package/dist/esm/plugins/trace-transaction/index.d.ts +1 -1
- package/dist/esm/plugins/trace-transaction/index.js +3 -3
- package/dist/esm/plugins/trace-transaction/types.d.ts +2 -2
- package/dist/esm/plugins/trace-transaction/utils.d.ts +3 -3
- package/dist/esm/plugins/trace-transaction/utils.js +4 -4
- package/dist/esm/plugins/try-runtime/index.js +5 -5
- package/dist/esm/rpc/index.d.ts +1 -1
- package/dist/esm/schema/index.d.ts +2 -2
- package/dist/esm/schema/index.js +4 -4
- package/dist/esm/server.d.ts +1 -1
- package/dist/esm/server.js +3 -3
- package/dist/esm/setup-with-server.d.ts +1 -1
- package/dist/esm/setup-with-server.js +2 -2
- package/dist/esm/utils/decoder.d.ts +2 -2
- package/dist/esm/utils/fetch-storages-worker.js +1 -1
- package/dist/esm/utils/fetch-storages.d.ts +1 -1
- package/dist/esm/utils/fetch-storages.js +5 -5
- package/dist/esm/utils/generate-html-diff.d.ts +2 -2
- package/dist/esm/utils/generate-html-diff.js +1 -1
- package/dist/esm/utils/open-html.js +2 -2
- package/dist/esm/utils/override.d.ts +2 -2
- package/dist/esm/utils/override.js +2 -2
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Block } from '@acala-network/chopsticks-core';
|
|
2
|
-
import { HexString } from '@polkadot/util/types';
|
|
1
|
+
import { type Block } from '@acala-network/chopsticks-core';
|
|
2
|
+
import type { HexString } from '@polkadot/util/types';
|
|
3
3
|
export declare const decodeStorageDiff: (block: Block, diff: [HexString, HexString | null][]) => Promise<{
|
|
4
4
|
oldState: {};
|
|
5
5
|
newState: {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiPromise } from '@polkadot/api';
|
|
2
|
-
import { HexString } from '@polkadot/util/types';
|
|
2
|
+
import type { HexString } from '@polkadot/util/types';
|
|
3
3
|
export declare const logger: import("pino").default.Logger<never, boolean>;
|
|
4
4
|
type FetchStorageConfigItem = HexString | string | Record<string, string | Record<string, any[]> | Record<string, any>[] | (string | any)[]>;
|
|
5
5
|
export type FetchStorageConfig = FetchStorageConfigItem[];
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import threads from 'node:worker_threads';
|
|
1
2
|
import { Api, defaultLogger } from '@acala-network/chopsticks-core';
|
|
2
|
-
import { ApiPromise } from '@polkadot/api';
|
|
3
3
|
import { SqliteDatabase } from '@acala-network/chopsticks-db';
|
|
4
|
+
import { ApiPromise } from '@polkadot/api';
|
|
4
5
|
import { WsProvider } from '@polkadot/rpc-provider';
|
|
5
|
-
import { compactStripLength, stringCamelCase, u8aToHex } from '@polkadot/util';
|
|
6
6
|
import { expandMetadata } from '@polkadot/types';
|
|
7
|
-
import {
|
|
7
|
+
import { compactStripLength, stringCamelCase, u8aToHex } from '@polkadot/util';
|
|
8
8
|
import { xxhashAsHex } from '@polkadot/util-crypto';
|
|
9
|
-
import
|
|
9
|
+
import { releaseProxy, wrap } from 'comlink';
|
|
10
10
|
import nodeEndpoint from 'comlink/dist/umd/node-adapter.js';
|
|
11
|
-
import
|
|
11
|
+
import _ from 'lodash';
|
|
12
12
|
const BATCH_SIZE = 1000;
|
|
13
13
|
export const logger = defaultLogger.child({
|
|
14
14
|
name: 'fetch-storages'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Block } from '@acala-network/chopsticks-core';
|
|
2
|
-
import { HexString } from '@polkadot/util/types';
|
|
1
|
+
import type { Block } from '@acala-network/chopsticks-core';
|
|
2
|
+
import type { HexString } from '@polkadot/util/types';
|
|
3
3
|
export declare const generateHtmlDiff: (block: Block, diff: [HexString, HexString | null][]) => Promise<string>;
|
|
4
4
|
export declare const generateHtmlDiffPreviewFile: (block: Block, diff: [HexString, HexString | null][], filename: string) => Promise<string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { decodeStorageDiff } from './decoder.js';
|
|
2
1
|
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
3
2
|
import _ from 'lodash';
|
|
3
|
+
import { decodeStorageDiff } from './decoder.js';
|
|
4
4
|
export const generateHtmlDiff = async (block, diff)=>{
|
|
5
5
|
const { oldState, delta } = await decodeStorageDiff(block, diff);
|
|
6
6
|
const htmlTemplate = readFileSync(new URL('template/diff.html', import.meta.url), 'utf-8');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { execSync } from 'node:child_process';
|
|
2
2
|
export const openHtml = (filePath)=>{
|
|
3
|
-
const start = process.platform
|
|
4
|
-
execSync(start
|
|
3
|
+
const start = process.platform === 'darwin' ? 'open' : process.platform === 'win32' ? 'start' : 'xdg-open';
|
|
4
|
+
execSync(`${start} ${filePath}`);
|
|
5
5
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Blockchain, StorageValues } from '@acala-network/chopsticks-core';
|
|
2
|
-
import { HexString } from '@polkadot/util/types';
|
|
1
|
+
import { type Blockchain, type StorageValues } from '@acala-network/chopsticks-core';
|
|
2
|
+
import type { HexString } from '@polkadot/util/types';
|
|
3
3
|
export declare const overrideStorage: (chain: Blockchain, storage?: string | StorageValues, at?: HexString) => Promise<void>;
|
|
4
4
|
export declare const overrideWasm: (chain: Blockchain, wasmPath?: string, at?: HexString) => Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isUrl, setStorage } from '@acala-network/chopsticks-core';
|
|
2
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { isUrl, setStorage } from '@acala-network/chopsticks-core';
|
|
3
3
|
import axios from 'axios';
|
|
4
4
|
import yaml from 'js-yaml';
|
|
5
5
|
import { defaultLogger } from '../logger.js';
|
|
@@ -38,7 +38,7 @@ export const overrideWasm = async (chain, wasmPath, at)=>{
|
|
|
38
38
|
// starts with 0x
|
|
39
39
|
wasmHex = wasm.toString().trim();
|
|
40
40
|
} else {
|
|
41
|
-
wasmHex =
|
|
41
|
+
wasmHex = `0x${wasm.toString('hex')}`;
|
|
42
42
|
}
|
|
43
43
|
if (at) {
|
|
44
44
|
const block = await chain.getBlock(at);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acala-network/chopsticks",
|
|
3
|
-
"version": "1.0.2
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"author": "Acala Developers <hello@acala.network>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"bin": "./chopsticks.cjs",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"depcheck": "npx depcheck --ignore-patterns='*.test.ts'"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@acala-network/chopsticks-core": "1.0.2
|
|
19
|
-
"@acala-network/chopsticks-db": "1.0.2
|
|
18
|
+
"@acala-network/chopsticks-core": "1.0.2",
|
|
19
|
+
"@acala-network/chopsticks-db": "1.0.2",
|
|
20
20
|
"@pnpm/npm-conf": "^2.3.1",
|
|
21
21
|
"@polkadot/api": "^15.0",
|
|
22
22
|
"@polkadot/api-augment": "^15.0",
|