aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/apiParse.js9
-rw-r--r--scripts/createExceptions.js32
2 files changed, 2 insertions, 39 deletions
diff --git a/scripts/apiParse.js b/scripts/apiParse.js
index 7e54b654..f13f1943 100644
--- a/scripts/apiParse.js
+++ b/scripts/apiParse.js
@@ -1,4 +1,4 @@
-const addUserSearch = function (input, table) {
+export const addUserSearch = function (input, table) {
var {search, starts_with, contains} = input
if (!table) { table = 'users' }
@@ -19,7 +19,7 @@ const addUserSearch = function (input, table) {
}
}
-const addTimeSearch = function (input, field) {
+export const addTimeSearch = function (input, field) {
if (!field) { field = 'updatedAt' }
var {since} = input
@@ -32,8 +32,3 @@ const addTimeSearch = function (input, field) {
}
}
-module.exports = {
- addUserSearch: addUserSearch,
- addTimeSearch: addTimeSearch,
-}
-
diff --git a/scripts/createExceptions.js b/scripts/createExceptions.js
deleted file mode 100644
index 26baeb7e..00000000
--- a/scripts/createExceptions.js
+++ /dev/null
@@ -1,32 +0,0 @@
-BitcoinCore = require("@asoltys/bitcoin-core");
-fs = require("fs");
-config = require("./config");
-bc = new BitcoinCore(config.bitcoin);
-l = require("pino")();
-require("./db");
-
-console.log(db.Payment);
-
-(async () => {
- payments = (
- await db.Payment.findAll({
- attributes: ["hash"],
- })
- ).map((p) => p.hash);
- const transactions = await bc.listTransactions("*", 1000);
- var stream = fs.createWriteStream("exceptions", {
- flags: "a",
- emitClose: true,
- });
- transactions.map((tx) => {
- if (!payments.includes(tx.txid)) {
- l.info("writing", tx.txid);
- stream.write(tx.txid + "\n");
- }
- });
- stream.end();
- stream.on("close", () => {
- l.info("done");
- process.exit();
- });
-})();