@acala-network/chopsticks-utils 0.9.6-2 → 0.9.6-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.
package/dist/cjs/index.js CHANGED
@@ -48,6 +48,9 @@ function _export_star(from, to) {
48
48
  });
49
49
  return from;
50
50
  }
51
+ const logger = _chopsticks.defaultLogger.child({
52
+ module: 'utils'
53
+ });
51
54
  const createConfig = ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, port, maxMemoryBlockCount, resume, runtimeLogLevel, allowUnresolvedImports })=>{
52
55
  // random port if not specified
53
56
  port = port ?? Math.floor(Math.random() * 10000) + 10000;
@@ -167,7 +170,7 @@ const sendTransaction = async (tx)=>{
167
170
  const signed = await tx;
168
171
  const deferred = defer();
169
172
  await signed.send((status)=>{
170
- console.log('tranaction status: ', status.status.toHuman());
173
+ logger.debug('tranaction status: ', status.status.toHuman());
171
174
  if (status.isInBlock || status.isFinalized) {
172
175
  deferred.resolve(status.events);
173
176
  }
package/dist/esm/index.js CHANGED
@@ -1,6 +1,9 @@
1
1
  import { ApiPromise, WsProvider } from '@polkadot/api';
2
- import { BuildBlockMode, connectParachains, connectVertical, fetchConfig, setupWithServer } from '@acala-network/chopsticks';
2
+ import { BuildBlockMode, connectParachains, connectVertical, defaultLogger, fetchConfig, setupWithServer } from '@acala-network/chopsticks';
3
3
  import { Keyring, createTestKeyring } from '@polkadot/keyring';
4
+ const logger = defaultLogger.child({
5
+ module: 'utils'
6
+ });
4
7
  export * from './signFake.js';
5
8
  export const createConfig = ({ endpoint, blockNumber, blockHash, wasmOverride, db, timeout, port, maxMemoryBlockCount, resume, runtimeLogLevel, allowUnresolvedImports })=>{
6
9
  // random port if not specified
@@ -121,7 +124,7 @@ export const sendTransaction = async (tx)=>{
121
124
  const signed = await tx;
122
125
  const deferred = defer();
123
126
  await signed.send((status)=>{
124
- console.log('tranaction status: ', status.status.toHuman());
127
+ logger.debug('tranaction status: ', status.status.toHuman());
125
128
  if (status.isInBlock || status.isFinalized) {
126
129
  deferred.resolve(status.events);
127
130
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acala-network/chopsticks-utils",
3
- "version": "0.9.6-2",
3
+ "version": "0.9.6-4",
4
4
  "author": "Acala Developers <hello@acala.network>",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -11,7 +11,7 @@
11
11
  "build:esm": "swc ./src --config-file ../../.esmswcrc -d dist/esm && tsc -p tsconfig.json --declarationDir dist/esm"
12
12
  },
13
13
  "dependencies": {
14
- "@acala-network/chopsticks": "0.9.6-2",
14
+ "@acala-network/chopsticks": "0.9.6-4",
15
15
  "@polkadot/api": "^10.10.1",
16
16
  "@polkadot/types": "^10.10.1"
17
17
  },