@pioneer-platform/pioneer-balance 8.3.25 → 8.3.26
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/lib/index.js +28 -17
- package/package.json +1 -1
package/lib/index.js
CHANGED
@@ -70,14 +70,14 @@ var Balance = /** @class */ (function () {
|
|
70
70
|
}
|
71
71
|
Balance.prototype.init = function () {
|
72
72
|
return __awaiter(this, void 0, void 0, function () {
|
73
|
-
var tag, evmNodes, e_1;
|
73
|
+
var tag, evmNodes, nodesInEth, e_1;
|
74
74
|
return __generator(this, function (_a) {
|
75
75
|
switch (_a.label) {
|
76
76
|
case 0:
|
77
77
|
tag = TAG + " | init_network | ";
|
78
78
|
_a.label = 1;
|
79
79
|
case 1:
|
80
|
-
_a.trys.push([1,
|
80
|
+
_a.trys.push([1, 5, , 6]);
|
81
81
|
this.networks = new Network.Network({});
|
82
82
|
return [4 /*yield*/, this.networks.init()];
|
83
83
|
case 2:
|
@@ -88,33 +88,44 @@ var Balance = /** @class */ (function () {
|
|
88
88
|
return [4 /*yield*/, this.networks.networks.ethereum.addNodes(evmNodes)];
|
89
89
|
case 3:
|
90
90
|
_a.sent();
|
91
|
-
return [
|
91
|
+
return [4 /*yield*/, this.networks.networks.ethereum.getNodes()];
|
92
92
|
case 4:
|
93
|
+
nodesInEth = _a.sent();
|
94
|
+
console.log(tag, "nodesInEth: ", nodesInEth.length);
|
95
|
+
return [2 /*return*/, true];
|
96
|
+
case 5:
|
93
97
|
e_1 = _a.sent();
|
94
98
|
console.error(tag, e_1);
|
95
99
|
throw e_1;
|
96
|
-
case
|
100
|
+
case 6: return [2 /*return*/];
|
97
101
|
}
|
98
102
|
});
|
99
103
|
});
|
100
104
|
};
|
101
105
|
Balance.prototype.getNodes = function (networkId) {
|
102
106
|
return __awaiter(this, void 0, void 0, function () {
|
103
|
-
var tag, nodes;
|
107
|
+
var tag, nodes, nodesEth, e_2;
|
104
108
|
return __generator(this, function (_a) {
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
109
|
+
switch (_a.label) {
|
110
|
+
case 0:
|
111
|
+
tag = TAG + " | getNodes | ";
|
112
|
+
_a.label = 1;
|
113
|
+
case 1:
|
114
|
+
_a.trys.push([1, 3, , 4]);
|
115
|
+
console.log(tag, "networkId: ", networkId);
|
116
|
+
console.log(tag, 'total nodes: ', this.nodes.length);
|
117
|
+
nodes = this.nodes.filter(function (node) { return node.networkId === networkId; });
|
118
|
+
console.log(tag, 'nodes: ', nodes.length);
|
119
|
+
return [4 /*yield*/, this.networks.networks.ethereum.getNodes()];
|
120
|
+
case 2:
|
121
|
+
nodesEth = _a.sent();
|
122
|
+
return [2 /*return*/, nodes];
|
123
|
+
case 3:
|
124
|
+
e_2 = _a.sent();
|
125
|
+
console.error(tag, e_2);
|
126
|
+
throw e_2;
|
127
|
+
case 4: return [2 /*return*/];
|
116
128
|
}
|
117
|
-
return [2 /*return*/];
|
118
129
|
});
|
119
130
|
});
|
120
131
|
};
|