@cardano-sdk/e2e 0.44.3 → 0.44.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/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.44.4](https://github.com/input-output-hk/cardano-js-sdk/compare/@cardano-sdk/e2e@0.44.3...@cardano-sdk/e2e@0.44.4) (2024-10-11)
7
+
8
+ **Note:** Version bump only for package @cardano-sdk/e2e
9
+
6
10
  ## [0.44.3](https://github.com/input-output-hk/cardano-js-sdk/compare/@cardano-sdk/e2e@0.44.2...@cardano-sdk/e2e@0.44.3) (2024-10-09)
7
11
 
8
12
  **Note:** Version bump only for package @cardano-sdk/e2e
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cardano-sdk/e2e",
3
- "version": "0.44.3",
3
+ "version": "0.44.4",
4
4
  "description": "End to end tests for the cardano-js-sdk packages.",
5
5
  "repository": "https://github.com/input-output-hk/cardano-js-sdk",
6
6
  "license": "Apache-2.0",
@@ -76,20 +76,20 @@
76
76
  "dependencies": {
77
77
  "@cardano-foundation/ledgerjs-hw-app-cardano": "^7.1.2",
78
78
  "@cardano-ogmios/client": "6.5.0",
79
- "@cardano-sdk/cardano-services": "~0.31.2",
80
- "@cardano-sdk/cardano-services-client": "~0.21.2",
79
+ "@cardano-sdk/cardano-services": "~0.31.3",
80
+ "@cardano-sdk/cardano-services-client": "~0.21.3",
81
81
  "@cardano-sdk/core": "~0.41.0",
82
82
  "@cardano-sdk/crypto": "~0.1.30",
83
83
  "@cardano-sdk/hardware-ledger": "~0.12.8",
84
84
  "@cardano-sdk/hardware-trezor": "~0.6.7",
85
85
  "@cardano-sdk/input-selection": "~0.13.23",
86
86
  "@cardano-sdk/key-management": "~0.24.6",
87
- "@cardano-sdk/ogmios": "~0.18.4",
87
+ "@cardano-sdk/ogmios": "~0.18.5",
88
88
  "@cardano-sdk/tx-construction": "~0.21.8",
89
89
  "@cardano-sdk/util": "~0.15.5",
90
- "@cardano-sdk/util-dev": "~0.23.4",
90
+ "@cardano-sdk/util-dev": "~0.23.5",
91
91
  "@cardano-sdk/util-rxjs": "~0.7.36",
92
- "@cardano-sdk/wallet": "~0.44.9",
92
+ "@cardano-sdk/wallet": "~0.44.10",
93
93
  "@dcspark/cardano-multiplatform-lib-nodejs": "^3.1.1",
94
94
  "@shiroyasha9/axios-fetch-adapter": "1.0.3",
95
95
  "axios": "^1.7.4",
@@ -120,9 +120,9 @@
120
120
  "@babel/preset-env": "^7.18.2",
121
121
  "@babel/preset-typescript": "^7.17.12",
122
122
  "@cardano-sdk/dapp-connector": "~0.12.40",
123
- "@cardano-sdk/projection": "~0.12.4",
124
- "@cardano-sdk/projection-typeorm": "~0.9.4",
125
- "@cardano-sdk/web-extension": "~0.34.8",
123
+ "@cardano-sdk/projection": "~0.12.5",
124
+ "@cardano-sdk/projection-typeorm": "~0.9.5",
125
+ "@cardano-sdk/web-extension": "~0.34.9",
126
126
  "@dcspark/cardano-multiplatform-lib-browser": "^3.1.1",
127
127
  "@emurgo/cardano-message-signing-asmjs": "^1.0.1",
128
128
  "@types/bunyan": "^1.8.8",
@@ -182,5 +182,5 @@
182
182
  "publishConfig": {
183
183
  "access": "public"
184
184
  },
185
- "gitHead": "0c3595bcdd71247e875c5691711f62ddd22c6de0"
185
+ "gitHead": "2e0e2c79bf24475ca7ceaefa16118b283c43e21f"
186
186
  }
@@ -6,8 +6,16 @@ import { SharedArray } from 'k6/data';
6
6
  import { check } from 'k6';
7
7
  import ws from 'k6/ws';
8
8
 
9
- const { HD_ACTIVE_ADDR_COUNT, HD_MAX_TX_HISTORY, TARGET_NET, WALLETS } = Object.assign(
10
- { HD_ACTIVE_ADDR_COUNT: '10', HD_MAX_TX_HISTORY: '100', TARGET_NET: 'mainnet', WALLETS: '100' },
9
+ const parameters = Object.assign(
10
+ {
11
+ CONNECTIONS_SECONDS: '3',
12
+ HD_ACTIVE_ADDR_COUNT: '10',
13
+ HD_MAX_TX_HISTORY: '100',
14
+ IDLE_SECONDS: '60',
15
+ TARGET_NET: 'mainnet',
16
+ WALLET_RESTORATION: 'false',
17
+ WALLETS: '100'
18
+ },
11
19
  // eslint-disable-next-line no-undef
12
20
  __ENV
13
21
  );
@@ -16,9 +24,12 @@ const { HD_ACTIVE_ADDR_COUNT, HD_MAX_TX_HISTORY, TARGET_NET, WALLETS } = Object.
16
24
  const dut = k6Utils.getDut(__ENV, { networks: ['mainnet', 'preprod'] });
17
25
  const url = `wss://${dut}/ws`;
18
26
 
19
- const activeAddrCount = Number.parseInt(HD_ACTIVE_ADDR_COUNT, 10);
20
- const maxTxHistory = Number.parseInt(HD_MAX_TX_HISTORY, 10);
21
- const numWallets = Number.parseInt(WALLETS, 10);
27
+ const activeAddrCount = Number.parseInt(parameters.HD_ACTIVE_ADDR_COUNT, 10);
28
+ const idleSeconds = Number.parseInt(parameters.IDLE_SECONDS, 10);
29
+ const connectionsSeconds = Number.parseInt(parameters.CONNECTIONS_SECONDS, 10);
30
+ const maxTxHistory = Number.parseInt(parameters.HD_MAX_TX_HISTORY, 10);
31
+ const numWallets = Number.parseInt(parameters.WALLETS, 10);
32
+ const walletRestoration = parameters.WALLETS === 'true';
22
33
 
23
34
  export const options = {
24
35
  ext: {
@@ -31,15 +42,15 @@ export const options = {
31
42
  connections: {
32
43
  executor: 'ramping-vus',
33
44
  gracefulRampDown: '0s',
34
- gracefulStop: '10m',
35
- stages: [{ duration: '3s', target: numWallets }],
45
+ gracefulStop: '60m',
46
+ stages: [{ duration: `${connectionsSeconds}s`, target: numWallets }],
36
47
  startVUs: 1
37
48
  }
38
49
  }
39
50
  };
40
51
 
41
52
  /** Wallet addresses extracted from the JSON dump file */
42
- const fileName = `../../dump/addresses/${TARGET_NET}.json`;
53
+ const fileName = `../../dump/addresses/${parameters.TARGET_NET}.json`;
43
54
  // eslint-disable-next-line no-undef
44
55
  const walletsOrig = new SharedArray('walletsData', () => JSON.parse(open(fileName)));
45
56
 
@@ -77,7 +88,9 @@ export const run = ({ wallets }) => {
77
88
  const vu = __VU;
78
89
  const wallet = wallets[vu % wallets.length]; // each wallet is a collection of addresses
79
90
 
91
+ // eslint-disable-next-line sonarjs/cognitive-complexity
80
92
  const res = ws.connect(url, null, (socket) => {
93
+ let blockNo = 0;
81
94
  let closed = false;
82
95
  let requestId = 0;
83
96
  let transactionsCount = 0;
@@ -92,7 +105,7 @@ export const run = ({ wallets }) => {
92
105
  return socket.setTimeout(() => {
93
106
  closed = true;
94
107
  socket.close();
95
- }, 1000);
108
+ }, idleSeconds * 1000);
96
109
  }
97
110
 
98
111
  const address =
@@ -100,15 +113,23 @@ export const run = ({ wallets }) => {
100
113
  ? wallet[requestId - 1].address
101
114
  : getDummyAddr(wallet[0].address, requestId - wallet.length);
102
115
 
103
- socket.send(JSON.stringify({ requestId, txsByAddresses: { addresses: [address], lower: 0 } }));
116
+ const lower = walletRestoration ? 0 : blockNo;
117
+
118
+ socket.send(JSON.stringify({ requestId, txsByAddresses: { addresses: [address], lower } }));
104
119
  };
105
120
 
106
121
  socket.on('message', (message) => {
107
- const { clientId, responseTo, transactions } = JSON.parse(message);
122
+ const { clientId, networkInfo, responseTo, transactions } = JSON.parse(message);
108
123
 
124
+ // Set operational stat
109
125
  if (clientId) operationalTrend.add(Date.now() - begin);
126
+
127
+ // Perform init with or without restoration
128
+ if (networkInfo) ({ blockNo } = networkInfo.ledgerTip);
110
129
  if (clientId || responseTo) nextAddress();
111
- if (transactions) transactionsCount += transactions.length;
130
+
131
+ // Count the incoming transactions
132
+ if (Array.isArray(transactions)) transactionsCount += transactions.length;
112
133
  });
113
134
 
114
135
  // Count unexpected close