suidouble 1.13.0 → 1.14.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 +8 -33
- package/index.js +17 -14
- package/lib/SuiCliCommands.js +80 -20
- package/lib/SuiCoin.js +37 -56
- package/lib/SuiCoins.js +75 -64
- package/lib/SuiCommonMethods.js +2 -4
- package/lib/SuiEvent.js +2 -4
- package/lib/SuiInBrowser.js +10 -15
- package/lib/SuiInBrowserAdapter.js +2 -6
- package/lib/SuiLocalTestValidator.js +7 -37
- package/lib/SuiMaster.js +86 -53
- package/lib/SuiMemoryObjectStorage.js +2 -4
- package/lib/SuiObject.js +4 -6
- package/lib/SuiPackage.js +9 -14
- package/lib/SuiPackageModule.js +11 -16
- package/lib/SuiPaginatedResponse.js +4 -6
- package/lib/SuiPseudoRandomAddress.js +4 -6
- package/lib/SuiTestScenario.js +6 -7
- package/lib/SuiTransaction.js +3 -5
- package/lib/SuiUtils.js +20 -15
- package/lib/data/{icons.json → icons.js} +4 -2
- package/package.json +5 -3
- package/test/coins.test.js +10 -4
- package/test/different_types_args.test.js +8 -4
- package/test/rpc.test.js +8 -2
- package/test/sui_in_browser.test.js +8 -2
- package/test/sui_master_basic.test.js +9 -2
- package/test/sui_master_onlocal.test.js +9 -4
- package/test/sui_test_scenario.test.js +8 -4
package/test/coins.test.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import t from 'tap';
|
|
4
|
+
import { SuiMaster, SuiLocalTestValidator, Transaction } from '../index.js';
|
|
4
5
|
const { test } = t;
|
|
5
6
|
|
|
6
|
-
const { SuiMaster, SuiLocalTestValidator, Transaction } = require('..');
|
|
7
|
-
|
|
8
7
|
let suiLocalTestValidator = null;
|
|
9
8
|
let suiMaster = null;
|
|
10
9
|
|
|
11
10
|
test('spawn local test node', async t => {
|
|
12
|
-
suiLocalTestValidator = await SuiLocalTestValidator.launch({ testFallbackEnabled: true });
|
|
11
|
+
suiLocalTestValidator = await SuiLocalTestValidator.launch({ testFallbackEnabled: true, debug: true, });
|
|
13
12
|
t.ok(suiLocalTestValidator.active);
|
|
14
13
|
|
|
15
14
|
// SuiLocalTestValidator runs as signle instance. So you can't start it twice with static method
|
|
@@ -34,6 +33,13 @@ test('type is normalized for SUI', async t => {
|
|
|
34
33
|
const suiCoin5 = suiMaster.suiCoins.get('2::sui::SUI');
|
|
35
34
|
const suiCoin6 = suiMaster.suiCoins.get('0000000000000000000000000000000000000000000000000000000000000002::sui::SUI');
|
|
36
35
|
|
|
36
|
+
console.log(suiCoin1.coinType);
|
|
37
|
+
console.log(suiCoin2.coinType);
|
|
38
|
+
console.log(suiCoin3.coinType);
|
|
39
|
+
console.log(suiCoin4.coinType);
|
|
40
|
+
console.log(suiCoin5.coinType);
|
|
41
|
+
console.log(suiCoin6.coinType);
|
|
42
|
+
|
|
37
43
|
t.ok(suiCoin1.coinType == suiCoin2.coinType);
|
|
38
44
|
t.ok(suiCoin1.coinType == suiCoin3.coinType);
|
|
39
45
|
t.ok(suiCoin1.coinType == suiCoin4.coinType);
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import t from 'tap';
|
|
4
|
+
import { SuiMaster, SuiLocalTestValidator, Transaction } from '../index.js';
|
|
5
|
+
|
|
6
|
+
import { fileURLToPath } from 'url';
|
|
7
|
+
import path from 'path';
|
|
6
8
|
|
|
7
|
-
const {
|
|
9
|
+
const { test } = t;
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
11
|
+
const __dirname = path.dirname(__filename);
|
|
8
12
|
|
|
9
13
|
let suiLocalTestValidator = null;
|
|
10
14
|
let suiMaster = null;
|
package/test/rpc.test.js
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import t from 'tap';
|
|
4
|
+
import { SuiMaster, SuiLocalTestValidator, Transaction } from '../index.js';
|
|
5
|
+
|
|
6
|
+
import { fileURLToPath } from 'url';
|
|
7
|
+
import path from 'path';
|
|
8
|
+
|
|
4
9
|
const { test } = t;
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
11
|
+
const __dirname = path.dirname(__filename);
|
|
5
12
|
|
|
6
|
-
const { SuiMaster } = require('..');
|
|
7
13
|
|
|
8
14
|
let suiMaster = null;
|
|
9
15
|
|
|
@@ -2,10 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
// just a basic test of InBrowser classes. No real interaction, just structure and events
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import t from 'tap';
|
|
6
|
+
import { SuiInBrowser } from '../index.js';
|
|
7
|
+
|
|
8
|
+
import { fileURLToPath } from 'url';
|
|
9
|
+
import path from 'path';
|
|
10
|
+
|
|
6
11
|
const { test } = t;
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = path.dirname(__filename);
|
|
7
14
|
|
|
8
|
-
const { SuiInBrowser } = require('..');
|
|
9
15
|
|
|
10
16
|
test('as single instance', async t => {
|
|
11
17
|
// probably you'd want a single instance of SuiInBrowser class on your dapp,
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import t from 'tap';
|
|
4
|
+
import { SuiMaster, MIST_PER_SUI } from '../index.js';
|
|
5
|
+
|
|
6
|
+
import { fileURLToPath } from 'url';
|
|
7
|
+
import path from 'path';
|
|
8
|
+
|
|
4
9
|
const { test } = t;
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
11
|
+
const __dirname = path.dirname(__filename);
|
|
12
|
+
|
|
5
13
|
|
|
6
|
-
const { SuiMaster, MIST_PER_SUI } = require('..');
|
|
7
14
|
|
|
8
15
|
test('initialization', async t => {
|
|
9
16
|
t.plan(2);
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const t = require('tap');
|
|
4
|
-
const { test } = t;
|
|
5
|
-
const path = require('path');
|
|
6
3
|
|
|
7
|
-
|
|
4
|
+
import t from 'tap';
|
|
5
|
+
import { SuiMaster, SuiLocalTestValidator } from '../index.js';
|
|
6
|
+
|
|
7
|
+
import { fileURLToPath } from 'url';
|
|
8
|
+
import path from 'path';
|
|
9
|
+
|
|
10
|
+
const { test } = t;
|
|
11
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
12
|
+
const __dirname = path.dirname(__filename);
|
|
8
13
|
|
|
9
14
|
let suiLocalTestValidator = null;
|
|
10
15
|
let suiMaster = null;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import t from 'tap';
|
|
4
|
+
import { SuiTestScenario } from '../index.js';
|
|
5
|
+
|
|
6
|
+
import { fileURLToPath } from 'url';
|
|
7
|
+
import path from 'path';
|
|
6
8
|
|
|
7
|
-
const {
|
|
9
|
+
const { test } = t;
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
11
|
+
const __dirname = path.dirname(__filename);
|
|
8
12
|
|
|
9
13
|
let testScenario = null;
|
|
10
14
|
|