@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.
Files changed (85) hide show
  1. package/dist/cjs/cli.js +10 -11
  2. package/dist/cjs/context.d.ts +1 -1
  3. package/dist/cjs/context.js +4 -3
  4. package/dist/cjs/logger.js +1 -1
  5. package/dist/cjs/plugins/decode-key/cli.js +1 -1
  6. package/dist/cjs/plugins/dry-run/cli.js +2 -2
  7. package/dist/cjs/plugins/dry-run/dry-run-extrinsic.d.ts +1 -1
  8. package/dist/cjs/plugins/dry-run/dry-run-extrinsic.js +10 -10
  9. package/dist/cjs/plugins/dry-run/dry-run-preimage.d.ts +1 -1
  10. package/dist/cjs/plugins/dry-run/dry-run-preimage.js +11 -11
  11. package/dist/cjs/plugins/dry-run/index.d.ts +3 -3
  12. package/dist/cjs/plugins/dry-run/index.js +2 -2
  13. package/dist/cjs/plugins/dry-run/rpc.d.ts +1 -1
  14. package/dist/cjs/plugins/dry-run/rpc.js +1 -1
  15. package/dist/cjs/plugins/fetch-storage/cli.js +1 -1
  16. package/dist/cjs/plugins/follow-chain/cli.js +7 -7
  17. package/dist/cjs/plugins/index.d.ts +1 -1
  18. package/dist/cjs/plugins/index.js +2 -2
  19. package/dist/cjs/plugins/run-block/cli.js +2 -2
  20. package/dist/cjs/plugins/run-block/rpc.d.ts +2 -2
  21. package/dist/cjs/plugins/trace-transaction/index.d.ts +1 -1
  22. package/dist/cjs/plugins/trace-transaction/index.js +3 -3
  23. package/dist/cjs/plugins/trace-transaction/types.d.ts +2 -2
  24. package/dist/cjs/plugins/trace-transaction/utils.d.ts +3 -3
  25. package/dist/cjs/plugins/trace-transaction/utils.js +4 -4
  26. package/dist/cjs/plugins/try-runtime/index.js +5 -5
  27. package/dist/cjs/rpc/index.d.ts +1 -1
  28. package/dist/cjs/schema/index.d.ts +2 -2
  29. package/dist/cjs/schema/index.js +4 -4
  30. package/dist/cjs/server.d.ts +1 -1
  31. package/dist/cjs/server.js +3 -3
  32. package/dist/cjs/setup-with-server.d.ts +1 -1
  33. package/dist/cjs/setup-with-server.js +2 -2
  34. package/dist/cjs/utils/decoder.d.ts +2 -2
  35. package/dist/cjs/utils/fetch-storages-worker.js +1 -1
  36. package/dist/cjs/utils/fetch-storages.d.ts +1 -1
  37. package/dist/cjs/utils/fetch-storages.js +5 -5
  38. package/dist/cjs/utils/generate-html-diff.d.ts +2 -2
  39. package/dist/cjs/utils/generate-html-diff.js +1 -1
  40. package/dist/cjs/utils/open-html.js +2 -2
  41. package/dist/cjs/utils/override.d.ts +2 -2
  42. package/dist/cjs/utils/override.js +2 -2
  43. package/dist/esm/cli.js +5 -6
  44. package/dist/esm/context.d.ts +1 -1
  45. package/dist/esm/context.js +4 -3
  46. package/dist/esm/logger.js +1 -1
  47. package/dist/esm/plugins/decode-key/cli.js +1 -1
  48. package/dist/esm/plugins/dry-run/cli.js +2 -2
  49. package/dist/esm/plugins/dry-run/dry-run-extrinsic.d.ts +1 -1
  50. package/dist/esm/plugins/dry-run/dry-run-extrinsic.js +10 -10
  51. package/dist/esm/plugins/dry-run/dry-run-preimage.d.ts +1 -1
  52. package/dist/esm/plugins/dry-run/dry-run-preimage.js +11 -11
  53. package/dist/esm/plugins/dry-run/index.d.ts +3 -3
  54. package/dist/esm/plugins/dry-run/index.js +2 -2
  55. package/dist/esm/plugins/dry-run/rpc.d.ts +1 -1
  56. package/dist/esm/plugins/dry-run/rpc.js +1 -1
  57. package/dist/esm/plugins/fetch-storage/cli.js +1 -1
  58. package/dist/esm/plugins/follow-chain/cli.js +3 -3
  59. package/dist/esm/plugins/index.d.ts +1 -1
  60. package/dist/esm/plugins/index.js +2 -2
  61. package/dist/esm/plugins/run-block/cli.js +2 -2
  62. package/dist/esm/plugins/run-block/rpc.d.ts +2 -2
  63. package/dist/esm/plugins/trace-transaction/index.d.ts +1 -1
  64. package/dist/esm/plugins/trace-transaction/index.js +3 -3
  65. package/dist/esm/plugins/trace-transaction/types.d.ts +2 -2
  66. package/dist/esm/plugins/trace-transaction/utils.d.ts +3 -3
  67. package/dist/esm/plugins/trace-transaction/utils.js +4 -4
  68. package/dist/esm/plugins/try-runtime/index.js +5 -5
  69. package/dist/esm/rpc/index.d.ts +1 -1
  70. package/dist/esm/schema/index.d.ts +2 -2
  71. package/dist/esm/schema/index.js +4 -4
  72. package/dist/esm/server.d.ts +1 -1
  73. package/dist/esm/server.js +3 -3
  74. package/dist/esm/setup-with-server.d.ts +1 -1
  75. package/dist/esm/setup-with-server.js +2 -2
  76. package/dist/esm/utils/decoder.d.ts +2 -2
  77. package/dist/esm/utils/fetch-storages-worker.js +1 -1
  78. package/dist/esm/utils/fetch-storages.d.ts +1 -1
  79. package/dist/esm/utils/fetch-storages.js +5 -5
  80. package/dist/esm/utils/generate-html-diff.d.ts +2 -2
  81. package/dist/esm/utils/generate-html-diff.js +1 -1
  82. package/dist/esm/utils/open-html.js +2 -2
  83. package/dist/esm/utils/override.d.ts +2 -2
  84. package/dist/esm/utils/override.js +2 -2
  85. 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
- import * as Comlink from 'comlink';
2
1
  import { parentPort } from 'node:worker_threads';
2
+ import * as Comlink from 'comlink';
3
3
  import nodeEndpoint from 'comlink/dist/umd/node-adapter.js';
4
4
  import { fetchStorages } from './fetch-storages.js';
5
5
  const api = {
@@ -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 { releaseProxy, wrap } from 'comlink';
7
+ import { compactStripLength, stringCamelCase, u8aToHex } from '@polkadot/util';
8
8
  import { xxhashAsHex } from '@polkadot/util-crypto';
9
- import _ from 'lodash';
9
+ import { releaseProxy, wrap } from 'comlink';
10
10
  import nodeEndpoint from 'comlink/dist/umd/node-adapter.js';
11
- import threads from 'node:worker_threads';
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 == 'darwin' ? 'open' : process.platform == 'win32' ? 'start' : 'xdg-open';
4
- execSync(start + ' ' + filePath);
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 = '0x' + wasm.toString('hex');
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-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-2",
19
- "@acala-network/chopsticks-db": "1.0.2-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",