@leofcoin/workers 1.5.3 → 1.5.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.
|
@@ -123,6 +123,7 @@ let totalTransactions;
|
|
|
123
123
|
let totalBurnAmount;
|
|
124
124
|
let totalMintAmount;
|
|
125
125
|
let totalTransferAmount;
|
|
126
|
+
let totalBlocks;
|
|
126
127
|
let blocks = [];
|
|
127
128
|
let contracts = {};
|
|
128
129
|
let lastBlock = { index: -1, hash: '0x0', previousHash: '0x0' };
|
|
@@ -290,6 +291,7 @@ const _ = {
|
|
|
290
291
|
totalBurnAmount = BigNumber.from(info?.totalBurnAmount ?? 0);
|
|
291
292
|
totalMintAmount = BigNumber.from(info?.totalMintAmount ?? 0);
|
|
292
293
|
totalTransferAmount = BigNumber.from(info?.totalTransferAmount ?? 0);
|
|
294
|
+
totalBlocks = BigNumber.from(info?.totalBlocks ?? 0);
|
|
293
295
|
if (fromState) {
|
|
294
296
|
lastBlock = message.lastBlock;
|
|
295
297
|
const setState = async (address, state) => {
|
|
@@ -410,6 +412,7 @@ const _ = {
|
|
|
410
412
|
addLoadedBlock: (block) => {
|
|
411
413
|
blocks[block.index - 1] = block;
|
|
412
414
|
lastBlock = blocks[blocks.length - 1];
|
|
415
|
+
totalBlocks = totalBlocks.add(1);
|
|
413
416
|
return true;
|
|
414
417
|
},
|
|
415
418
|
loadBlock: (block) => {
|
|
@@ -440,6 +443,9 @@ worker.onmessage(({ id, type, input }) => {
|
|
|
440
443
|
case 'contracts':
|
|
441
444
|
respond(id, contracts);
|
|
442
445
|
break;
|
|
446
|
+
case 'totalContracts':
|
|
447
|
+
respond(id, Object.keys(contracts).length);
|
|
448
|
+
break;
|
|
443
449
|
case 'nativeMints':
|
|
444
450
|
respond(id, nativeMints);
|
|
445
451
|
break;
|
|
@@ -459,7 +465,7 @@ worker.onmessage(({ id, type, input }) => {
|
|
|
459
465
|
respond(id, totalTransferAmount);
|
|
460
466
|
break;
|
|
461
467
|
case 'totalBlocks':
|
|
462
|
-
respond(id,
|
|
468
|
+
respond(id, totalBlocks);
|
|
463
469
|
break;
|
|
464
470
|
case 'blocks':
|
|
465
471
|
respond(id, input ? blocks.slice(input.from, input.to) : blocks);
|
|
@@ -123,6 +123,7 @@ let totalTransactions;
|
|
|
123
123
|
let totalBurnAmount;
|
|
124
124
|
let totalMintAmount;
|
|
125
125
|
let totalTransferAmount;
|
|
126
|
+
let totalBlocks;
|
|
126
127
|
let blocks = [];
|
|
127
128
|
let contracts = {};
|
|
128
129
|
let lastBlock = { index: -1, hash: '0x0', previousHash: '0x0' };
|
|
@@ -290,6 +291,7 @@ const _ = {
|
|
|
290
291
|
totalBurnAmount = BigNumber.from(info?.totalBurnAmount ?? 0);
|
|
291
292
|
totalMintAmount = BigNumber.from(info?.totalMintAmount ?? 0);
|
|
292
293
|
totalTransferAmount = BigNumber.from(info?.totalTransferAmount ?? 0);
|
|
294
|
+
totalBlocks = BigNumber.from(info?.totalBlocks ?? 0);
|
|
293
295
|
if (fromState) {
|
|
294
296
|
lastBlock = message.lastBlock;
|
|
295
297
|
const setState = async (address, state) => {
|
|
@@ -410,6 +412,7 @@ const _ = {
|
|
|
410
412
|
addLoadedBlock: (block) => {
|
|
411
413
|
blocks[block.index - 1] = block;
|
|
412
414
|
lastBlock = blocks[blocks.length - 1];
|
|
415
|
+
totalBlocks = totalBlocks.add(1);
|
|
413
416
|
return true;
|
|
414
417
|
},
|
|
415
418
|
loadBlock: (block) => {
|
|
@@ -440,6 +443,9 @@ worker.onmessage(({ id, type, input }) => {
|
|
|
440
443
|
case 'contracts':
|
|
441
444
|
respond(id, contracts);
|
|
442
445
|
break;
|
|
446
|
+
case 'totalContracts':
|
|
447
|
+
respond(id, Object.keys(contracts).length);
|
|
448
|
+
break;
|
|
443
449
|
case 'nativeMints':
|
|
444
450
|
respond(id, nativeMints);
|
|
445
451
|
break;
|
|
@@ -459,7 +465,7 @@ worker.onmessage(({ id, type, input }) => {
|
|
|
459
465
|
respond(id, totalTransferAmount);
|
|
460
466
|
break;
|
|
461
467
|
case 'totalBlocks':
|
|
462
|
-
respond(id,
|
|
468
|
+
respond(id, totalBlocks);
|
|
463
469
|
break;
|
|
464
470
|
case 'blocks':
|
|
465
471
|
respond(id, input ? blocks.slice(input.from, input.to) : blocks);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leofcoin/workers",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4",
|
|
4
4
|
"description": "Workers used in @leofcoin/chain",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -20,18 +20,17 @@
|
|
|
20
20
|
"scripts": {
|
|
21
21
|
"prettier": "prettier src --config ./../../.prettierrc --write",
|
|
22
22
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
23
|
-
"npm-check-updates": "npx npm-check-updates -
|
|
24
|
-
"check-dependencies": "npx depcheck",
|
|
23
|
+
"npm-check-updates": "npx npm-check-updates -u --install always",
|
|
25
24
|
"build": "rollup -c --silent error --cache true"
|
|
26
25
|
},
|
|
27
26
|
"keywords": [],
|
|
28
27
|
"author": "",
|
|
29
28
|
"license": "MIT",
|
|
30
29
|
"dependencies": {
|
|
31
|
-
"@leofcoin/addresses": "^1.0.
|
|
32
|
-
"@leofcoin/lib": "^1.2.
|
|
30
|
+
"@leofcoin/addresses": "^1.0.24",
|
|
31
|
+
"@leofcoin/lib": "^1.2.44",
|
|
33
32
|
"@leofcoin/messages": "^1.4.15",
|
|
34
|
-
"@leofcoin/storage": "^3.5.
|
|
33
|
+
"@leofcoin/storage": "^3.5.31",
|
|
35
34
|
"@leofcoin/utils": "^1.1.18",
|
|
36
35
|
"@vandeurenglenn/easy-worker": "^1.0.2"
|
|
37
36
|
}
|