@acala-network/chopsticks-testing 0.9.4-2 → 0.9.4-4

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.
@@ -0,0 +1,39 @@
1
+ import { ApiPromise } from '@polkadot/api';
2
+ import { Codec } from '@polkadot/types/types';
3
+ export type EventFilter = string | {
4
+ method: string;
5
+ section: string;
6
+ };
7
+ export type RedactOptions = {
8
+ number?: boolean | number;
9
+ hash?: boolean;
10
+ hex?: boolean;
11
+ address?: boolean;
12
+ redactKeys?: RegExp;
13
+ removeKeys?: RegExp;
14
+ };
15
+ export declare class Checker {
16
+ #private;
17
+ constructor(value: any, message?: string);
18
+ toHuman(): this;
19
+ toHex(): this;
20
+ toJson(): this;
21
+ message(message: string): this;
22
+ filterEvents(...filters: EventFilter[]): this;
23
+ redact(options?: RedactOptions): this;
24
+ map(fn: (value: any) => any): this;
25
+ pipe(fn?: (value: Checker) => Checker): Checker;
26
+ value(): Promise<any>;
27
+ toMatchSnapshot(msg?: string): Promise<void>;
28
+ }
29
+ export declare const check: (value: any, msg?: string) => Checker;
30
+ type Api = {
31
+ api: ApiPromise;
32
+ };
33
+ export declare const checkEvents: ({ events }: {
34
+ events: Promise<Codec[] | Codec>;
35
+ }, ...filters: EventFilter[]) => Checker;
36
+ export declare const checkSystemEvents: ({ api }: Api, ...filters: EventFilter[]) => Checker;
37
+ export declare const checkUmp: ({ api }: Api) => Checker;
38
+ export declare const checkHrmp: ({ api }: Api) => Checker;
39
+ export {};
@@ -0,0 +1,16 @@
1
+ import { ApiPromise } from '@polkadot/api';
2
+ import { Codec } from '@polkadot/types/types';
3
+ export * from './check.js';
4
+ export * from '@acala-network/chopsticks-utils';
5
+ type CodecOrArray = Codec | Codec[];
6
+ export declare const expectJson: (codec: CodecOrArray) => import("@vitest/expect").Assertion<any>;
7
+ export declare const expectHex: (codec: CodecOrArray) => import("@vitest/expect").Assertion<any>;
8
+ type EventFilter = string | {
9
+ method: string;
10
+ section: string;
11
+ };
12
+ export declare const matchEvents: (events: Promise<Codec[] | Codec>, ...filters: EventFilter[]) => Promise<void>;
13
+ export declare const matchSystemEvents: ({ api }: {
14
+ api: ApiPromise;
15
+ }, ...filters: EventFilter[]) => Promise<void>;
16
+ export declare const redact: (data: any | Promise<any>) => Promise<any>;
package/package.json CHANGED
@@ -1,18 +1,17 @@
1
1
  {
2
2
  "name": "@acala-network/chopsticks-testing",
3
- "version": "0.9.4-2",
3
+ "version": "0.9.4-4",
4
4
  "author": "Acala Developers <hello@acala.network>",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "scripts": {
8
- "clean": "rm -rf dist",
9
- "build": "yarn clean && yarn build:cjs && yarn build:esm && yarn build:types",
10
- "build:cjs": "swc ./src --config-file ../../.cjsswcrc -d dist/cjs && echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json",
11
- "build:esm": "swc ./src --config-file ../../.esmswcrc -d dist/esm",
12
- "build:types": "tsc -p tsconfig.json --emitDeclarationOnly --outDir dist/types"
8
+ "clean": "rm -rf dist tsconfig.tsbuildinfo",
9
+ "build": "yarn clean && yarn build:cjs && yarn build:esm",
10
+ "build:cjs": "swc ./src --config-file ../../.cjsswcrc -d dist/cjs && tsc -p tsconfig.json --declarationDir dist/cjs && echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json",
11
+ "build:esm": "swc ./src --config-file ../../.esmswcrc -d dist/esm && tsc -p tsconfig.json --declarationDir dist/esm"
13
12
  },
14
13
  "dependencies": {
15
- "@acala-network/chopsticks-utils": "0.9.4-2",
14
+ "@acala-network/chopsticks-utils": "0.9.4-4",
16
15
  "@polkadot/api": "^10.10.1",
17
16
  "@polkadot/types": "^10.10.1"
18
17
  },
@@ -27,26 +26,20 @@
27
26
  },
28
27
  "files": [
29
28
  "dist/esm/**",
30
- "dist/cjs/**",
31
- "dist/types/**"
29
+ "dist/cjs/**"
32
30
  ],
33
31
  "main": "./dist/cjs/index.js",
34
32
  "module": "./dist/esm/index.js",
35
- "types": "./dist/types/index.d.ts",
36
33
  "exports": {
37
34
  ".": {
38
- "types": "./dist/types/index.d.ts",
39
35
  "require": "./dist/cjs/index.js",
40
36
  "import": "./dist/esm/index.js",
41
37
  "default": "./dist/esm/index.js"
42
38
  },
43
39
  "./*": {
44
- "types": "./dist/types/*.d.ts",
45
40
  "require": "./dist/cjs/*.js",
46
41
  "import": "./dist/esm/*.js",
47
42
  "default": "./dist/esm/*.js"
48
- },
49
- "./package.json": "./package.json",
50
- "./package.cjs.json": "./dist/cjs/package.json"
43
+ }
51
44
  }
52
45
  }
File without changes
File without changes