diff --git a/middleware.js b/middleware.js index 3c6f06b..897fe61 100644 --- a/middleware.js +++ b/middleware.js @@ -1,6 +1,6 @@ const { hasUnconfirmedTransactions } = require("./chia/wallet"); -export const assertNoPendingTransactions = async (req, res, next) => { +const assertNoPendingTransactions = async (req, res, next) => { const hasPendingTransactions = await hasUnconfirmedTransactions(); if (hasPendingTransactions) { @@ -12,3 +12,5 @@ export const assertNoPendingTransactions = async (req, res, next) => { next(); }; + +module.exports = { assertNoPendingTransactions }; diff --git a/package.json b/package.json index 3df98fe..99f7af7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "climate-tokenization-engine", - "version": "1.3.8", + "version": "1.3.9", "bin": "./server.js", "description": "", "main": "proxy.js", diff --git a/server.js b/server.js index 402404c..ecaee4c 100644 --- a/server.js +++ b/server.js @@ -9,7 +9,6 @@ const cors = require("cors"); const os = require("os"); const formData = require("express-form-data"); const scheduler = require("./tasks"); -const { assertNoPendingTransactions } = require("./middleware"); const { getHomeOrgUid } = require("./utils/coreRegApi"); @@ -417,7 +416,7 @@ const confirmTokenCreationWithTransactionId = async ( return false; }; -app.post("/tokenize", validator.body(tokenizeUnitSchema), assertNoPendingTransactions(), async (req, res) => { +app.post("/tokenize", validator.body(tokenizeUnitSchema), async (req, res) => { try { console.log({ token: {