@acala-network/chopsticks 0.2.3 → 0.3.1
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/README.md +12 -1
- package/dist/api.d.ts +3 -2
- package/dist/api.js +15 -20
- package/dist/blockchain/block-builder.d.ts +5 -0
- package/dist/blockchain/block-builder.js +168 -0
- package/dist/blockchain/block.d.ts +6 -4
- package/dist/blockchain/block.js +22 -23
- package/dist/blockchain/head-state.d.ts +4 -2
- package/dist/blockchain/head-state.js +13 -7
- package/dist/blockchain/index.d.ts +13 -8
- package/dist/blockchain/index.js +44 -26
- package/dist/blockchain/inherent/index.d.ts +19 -0
- package/dist/blockchain/inherent/index.js +36 -0
- package/dist/blockchain/inherent/para-enter.d.ts +7 -0
- package/dist/blockchain/inherent/para-enter.js +33 -0
- package/dist/blockchain/inherent/parachain/babe-randomness.d.ts +7 -0
- package/dist/blockchain/inherent/parachain/babe-randomness.js +15 -0
- package/dist/blockchain/inherent/parachain/nimbus-author-inherent.d.ts +7 -0
- package/dist/blockchain/inherent/parachain/nimbus-author-inherent.js +15 -0
- package/dist/blockchain/inherent/parachain/validation-data.d.ts +25 -0
- package/dist/blockchain/{inherents.js → inherent/parachain/validation-data.js} +77 -46
- package/dist/blockchain/txpool.d.ts +17 -2
- package/dist/blockchain/txpool.js +11 -107
- package/dist/dry-run.d.ts +2 -0
- package/dist/dry-run.js +30 -0
- package/dist/executor.d.ts +17 -3
- package/dist/executor.js +43 -3
- package/dist/executor.test.js +16 -9
- package/dist/genesis-provider.d.ts +5 -0
- package/dist/genesis-provider.js +15 -3
- package/dist/index.d.ts +1 -18
- package/dist/index.js +79 -148
- package/dist/rpc/dev.js +39 -2
- package/dist/rpc/shared.d.ts +0 -4
- package/dist/rpc/substrate/author.d.ts +1 -1
- package/dist/rpc/substrate/author.js +7 -2
- package/dist/rpc/substrate/chain.js +2 -2
- package/dist/rpc/substrate/state.js +1 -1
- package/dist/rpc/substrate/system.js +3 -3
- package/dist/run-block.d.ts +2 -0
- package/dist/run-block.js +47 -0
- package/dist/schema/index.js +1 -1
- package/dist/server.d.ts +3 -3
- package/dist/server.js +26 -11
- package/dist/setup-with-server.d.ts +8 -0
- package/dist/setup-with-server.js +23 -0
- package/dist/setup.d.ts +10 -0
- package/dist/setup.js +67 -0
- package/dist/utils/decoder.d.ts +17 -0
- package/dist/utils/decoder.js +101 -0
- package/dist/utils/generate-html-diff.d.ts +4 -0
- package/dist/utils/generate-html-diff.js +20 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +9 -1
- package/dist/utils/open-html.d.ts +1 -0
- package/dist/utils/open-html.js +9 -0
- package/dist/utils/proof.d.ts +10 -2
- package/dist/utils/proof.js +12 -8
- package/dist/utils/set-storage.d.ts +2 -1
- package/dist/utils/time-travel.d.ts +5 -0
- package/dist/utils/time-travel.js +64 -0
- package/dist/xcm/index.d.ts +3 -0
- package/dist/xcm/index.js +67 -0
- package/package.json +10 -7
- package/dist/bindings.d.ts +0 -2
- package/dist/bindings.js +0 -31
- package/dist/blockchain/inherents.d.ts +0 -24
package/dist/bindings.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setupBindings = void 0;
|
|
4
|
-
const logger_1 = require("./logger");
|
|
5
|
-
const logger = logger_1.defaultLogger.child({ name: 'binding' });
|
|
6
|
-
const setupBindings = (chain) => {
|
|
7
|
-
global._chopsticks_binding_ = {
|
|
8
|
-
getStorage: async function (blockHash, key) {
|
|
9
|
-
const block = await chain.getBlock(blockHash);
|
|
10
|
-
if (!block)
|
|
11
|
-
throw Error(`Block not found ${blockHash}`);
|
|
12
|
-
const value = await block.get(key);
|
|
13
|
-
logger.trace({ blockHash, key, value: value && (0, logger_1.truncate)(value) }, 'exec_storageGet');
|
|
14
|
-
return value;
|
|
15
|
-
},
|
|
16
|
-
getPrefixKeys: async function (blockHash, key) {
|
|
17
|
-
const block = await chain.getBlock(blockHash);
|
|
18
|
-
if (!block)
|
|
19
|
-
throw Error(`Block not found ${blockHash}`);
|
|
20
|
-
return block.getKeysPaged({ prefix: key, pageSize: 1000, startKey: key });
|
|
21
|
-
},
|
|
22
|
-
getNextKey: async function (blockHash, key) {
|
|
23
|
-
const block = await chain.getBlock(blockHash);
|
|
24
|
-
if (!block)
|
|
25
|
-
throw Error(`Block not found ${blockHash}`);
|
|
26
|
-
const keys = await block.getKeysPaged({ prefix: key, pageSize: 1, startKey: key });
|
|
27
|
-
return keys.length > 0 ? keys[0] : '0x';
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
exports.setupBindings = setupBindings;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Block } from './block';
|
|
2
|
-
import { DecoratedMeta } from '@polkadot/types/metadata/decorate/types';
|
|
3
|
-
import { HexString } from '@polkadot/util/types';
|
|
4
|
-
export interface CreateInherents {
|
|
5
|
-
createInherents(meta: DecoratedMeta, timestamp: number, parent: Block): Promise<HexString[]>;
|
|
6
|
-
}
|
|
7
|
-
export interface InherentProvider extends CreateInherents {
|
|
8
|
-
getTimestamp(blockNumber: number): number;
|
|
9
|
-
}
|
|
10
|
-
export declare class SetTimestamp implements InherentProvider {
|
|
11
|
-
#private;
|
|
12
|
-
constructor(getTimestamp?: (blockNumber: number) => number);
|
|
13
|
-
createInherents(meta: DecoratedMeta, timestamp: number, _parent: Block): Promise<HexString[]>;
|
|
14
|
-
getTimestamp(blockNumber: number): number;
|
|
15
|
-
}
|
|
16
|
-
export declare class InherentProviders implements InherentProvider {
|
|
17
|
-
#private;
|
|
18
|
-
constructor(base: InherentProvider, providers: CreateInherents[]);
|
|
19
|
-
createInherents(meta: DecoratedMeta, timestamp: number, parent: Block): Promise<HexString[]>;
|
|
20
|
-
getTimestamp(blockNumber: number): number;
|
|
21
|
-
}
|
|
22
|
-
export declare class SetValidationData implements CreateInherents {
|
|
23
|
-
createInherents(meta: DecoratedMeta, _timestamp: number, parent: Block): Promise<HexString[]>;
|
|
24
|
-
}
|