suidouble 1.24.0 → 1.26.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 CHANGED
@@ -339,6 +339,17 @@ await package.publish();
339
339
  console.log('published as', package.address);
340
340
  ```
341
341
 
342
+ Optionally, you can switch sui's env of `sui client switch` for the build (useful for Automated Address Management of dependencies via their Move.lock)
343
+
344
+ ```javascript
345
+ const package = suiMaster.addPackage({
346
+ path: '../path_to_move_project_root/',
347
+ });
348
+ await package.build({ env: 'testnet', });
349
+ await package.publish();
350
+
351
+ ```
352
+
342
353
  ### upgrading the package
343
354
 
344
355
  Same, it's for CLI as it re-builds the package.
@@ -86,25 +86,15 @@ export default class SuiLocalTestValidator extends SuiCommonMethods {
86
86
  return this;
87
87
  }
88
88
 
89
- this.log('launching sui-test-validator ...');
89
+ this.log('launching sui-test-validator (sui start)...');
90
90
 
91
91
  try {
92
- try {
93
- // try sui-test-validator
94
- const params = [];
95
- if (this._epochDuration) {
96
- params.push('--epoch-duration-ms');
97
- params.push(this._epochDuration);
98
- }
99
- this._child = await SuiCliCommands.spawn('sui-test-validator', params, { RUST_LOG: 'consensus=off' });
100
- } catch (e) {
101
- this.log('can not launch sui-test-validator. Trying to run "sui start"...');
102
- const params = [];
103
- params.push('start');
104
- params.push('--with-faucet');
105
- params.push('--force-regenesis');
106
- this._child = await SuiCliCommands.spawn('sui', params, { RUST_LOG: 'off,sui_node=info' });
107
- }
92
+ this.log('Trying to run "sui start"...');
93
+ const params = [];
94
+ params.push('start');
95
+ params.push('--with-faucet');
96
+ params.push('--force-regenesis');
97
+ this._child = await SuiCliCommands.spawn('sui', params, { RUST_LOG: 'off,sui_node=info' });
108
98
  } catch (e) {
109
99
  if (this._testFallbackEnabled) {
110
100
  // can't start local node. Let's switch to sui:dev
package/lib/SuiPackage.js CHANGED
@@ -509,6 +509,13 @@ export default class SuiPackage extends SuiObject {
509
509
  throw new Error('Cant build a package with no path defined');
510
510
  }
511
511
 
512
+ if (params.env) {
513
+ // switch to env
514
+ this.log('switching environment to', params.env);
515
+ const switchResult = await SuiCliCommands.exec(`sui client switch --env ${params.env}`);
516
+ this.log(switchResult);
517
+ }
518
+
512
519
  let command = `sui move build --dump-bytecode-as-base64 --path ${path}`;
513
520
  if (params.withUnpublishedDependencies) {
514
521
  command = `sui move build --with-unpublished-dependencies --dump-bytecode-as-base64 --path ${path}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suidouble",
3
- "version": "1.24.0",
3
+ "version": "1.26.1",
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
  "type": "module",
@@ -23,7 +23,7 @@
23
23
  "license": "Apache-2.0",
24
24
  "dependencies": {
25
25
  "@mysten/bcs": "^1.5.0",
26
- "@mysten/sui": "^1.24.0",
26
+ "@mysten/sui": "^1.26.1",
27
27
  "@polymedia/coinmeta": "^0.0.17",
28
28
  "@scure/bip39": "^1.5.4",
29
29
  "@wallet-standard/core": "^1.0.3",