suidouble 0.0.42 → 0.0.43

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 CHANGED
@@ -321,7 +321,7 @@ Same, it's for CLI as it re-builds the package.
321
321
  ```javascript
322
322
  const { SuiMaster } = require('suidouble');
323
323
 
324
- const provider = 'local';// or await SuiLocalTestValidator.launch({debug: true});
324
+ const provider = 'local';// or await SuiLocalTestValidator.launch({debug: true, epochDuration: 30000});
325
325
 
326
326
  const suiMaster = new SuiMaster({ debug: true, as: 'admin', provider: provider, });
327
327
  await suiMaster.requestSuiFromFaucet();
@@ -15,7 +15,7 @@ try {
15
15
  } catch (e) {}
16
16
 
17
17
  class SuiCliCommands {
18
- static async spawn(command, envVars = {}) {
18
+ static async spawn(command, params = [], envVars = {}) {
19
19
  if (!doSpawn) {
20
20
  throw new Error('can not spawn a proccess in this env');
21
21
  }
@@ -23,7 +23,7 @@ class SuiCliCommands {
23
23
  return await new Promise((res,rej)=>{
24
24
  let success = true;
25
25
  let e = null;
26
- const proc = doSpawn(command, [], {
26
+ const proc = doSpawn(command, params, {
27
27
  env: {
28
28
  ...process.env,
29
29
  ...envVars,
@@ -17,6 +17,8 @@ class SuiLocalTestValidator extends SuiCommonMethods {
17
17
  this._testFallbackEnabled = true;
18
18
  }
19
19
 
20
+ this._epochDuration = params.epochDuration || null;
21
+
20
22
  this._providerName = 'sui:localnet';
21
23
  }
22
24
 
@@ -60,7 +62,12 @@ class SuiLocalTestValidator extends SuiCommonMethods {
60
62
  this.log('launching sui-test-validator ...');
61
63
 
62
64
  try {
63
- this._child = await SuiCliCommands.spawn('sui-test-validator', { RUST_LOG: 'consensus=off' });
65
+ const params = [];
66
+ if (this._epochDuration) {
67
+ params.push('--epoch-duration-ms');
68
+ params.push(this._epochDuration);
69
+ }
70
+ this._child = await SuiCliCommands.spawn('sui-test-validator', params, { RUST_LOG: 'consensus=off' });
64
71
  } catch (e) {
65
72
  if (this._testFallbackEnabled) {
66
73
  // can't start local node. Let's switch to sui:dev
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suidouble",
3
- "version": "0.0.42",
3
+ "version": "0.0.43",
4
4
  "description": "Set of provider, package and object classes for javascript representation of Sui Move smart contracts. Use same code for publishing, upgrading, integration testing, interaction with smart contracts and integration in browser web3 dapps",
5
5
  "main": "index.js",
6
6
  "scripts": {