@pioneer-platform/pioneer 8.2.16 → 8.2.17
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 +18 -11
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1016,7 +1016,7 @@ var update_pubkeys = function (username, pubkeys, context) {
|
|
|
1016
1016
|
*/
|
|
1017
1017
|
var register_pubkeys = function (username, pubkeys) {
|
|
1018
1018
|
return __awaiter(this, void 0, void 0, function () {
|
|
1019
|
-
var tag, saveActions, allBalances, output, i, pubkeyInfo, nativeAsset, pubkeyExists, entryMongo, xpub, result, zpub, result, result, action, pushTagMongo, saveMongoBulk, allPubkeys, i, pubkeyInfo,
|
|
1019
|
+
var tag, saveActions, allBalances, output, i, pubkeyInfo, nativeAsset, pubkeyExists, entryMongo, xpub, result, zpub, result, result, action, pushTagMongo, saveMongoBulk, e_9, allPubkeys, i, pubkeyInfo, e_10;
|
|
1020
1020
|
var _a, _b;
|
|
1021
1021
|
return __generator(this, function (_c) {
|
|
1022
1022
|
switch (_c.label) {
|
|
@@ -1024,7 +1024,7 @@ var register_pubkeys = function (username, pubkeys) {
|
|
|
1024
1024
|
tag = TAG + " | register_pubkeys | ";
|
|
1025
1025
|
_c.label = 1;
|
|
1026
1026
|
case 1:
|
|
1027
|
-
_c.trys.push([1,
|
|
1027
|
+
_c.trys.push([1, 20, , 21]);
|
|
1028
1028
|
log.debug(tag, "input: ", { username: username, pubkeys: pubkeys });
|
|
1029
1029
|
saveActions = [];
|
|
1030
1030
|
allBalances = [];
|
|
@@ -1147,14 +1147,21 @@ var register_pubkeys = function (username, pubkeys) {
|
|
|
1147
1147
|
case 14:
|
|
1148
1148
|
//bulk write to mongo
|
|
1149
1149
|
log.info(tag, "saveActions: ", saveActions);
|
|
1150
|
-
if (!(saveActions.length > 0)) return [3 /*break*/,
|
|
1151
|
-
|
|
1150
|
+
if (!(saveActions.length > 0)) return [3 /*break*/, 18];
|
|
1151
|
+
_c.label = 15;
|
|
1152
1152
|
case 15:
|
|
1153
|
+
_c.trys.push([15, 17, , 18]);
|
|
1154
|
+
return [4 /*yield*/, pubkeysDB.bulkWrite(saveActions, { ordered: false })];
|
|
1155
|
+
case 16:
|
|
1153
1156
|
saveMongoBulk = _c.sent();
|
|
1154
1157
|
log.info(tag, "saveMongoBulk: ", saveMongoBulk);
|
|
1155
|
-
|
|
1156
|
-
case 16: return [4 /*yield*/, pubkeysDB.find({ tags: { $in: [username] } })];
|
|
1158
|
+
return [3 /*break*/, 18];
|
|
1157
1159
|
case 17:
|
|
1160
|
+
e_9 = _c.sent();
|
|
1161
|
+
log.error("Failed to update in bulk!");
|
|
1162
|
+
return [3 /*break*/, 18];
|
|
1163
|
+
case 18: return [4 /*yield*/, pubkeysDB.find({ tags: { $in: [username] } })];
|
|
1164
|
+
case 19:
|
|
1158
1165
|
allPubkeys = _c.sent();
|
|
1159
1166
|
log.info(tag, "allPubkeys: ", allPubkeys.length);
|
|
1160
1167
|
//get all balances for username
|
|
@@ -1166,11 +1173,11 @@ var register_pubkeys = function (username, pubkeys) {
|
|
|
1166
1173
|
(_b = output.nfts).push.apply(_b, pubkeyInfo.nfts);
|
|
1167
1174
|
}
|
|
1168
1175
|
return [2 /*return*/, output];
|
|
1169
|
-
case
|
|
1170
|
-
|
|
1171
|
-
console.error(tag, "e: ",
|
|
1172
|
-
throw
|
|
1173
|
-
case
|
|
1176
|
+
case 20:
|
|
1177
|
+
e_10 = _c.sent();
|
|
1178
|
+
console.error(tag, "e: ", e_10);
|
|
1179
|
+
throw e_10;
|
|
1180
|
+
case 21: return [2 /*return*/];
|
|
1174
1181
|
}
|
|
1175
1182
|
});
|
|
1176
1183
|
});
|