Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: 1.3.9 #160

Merged
merged 3 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion middleware.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand All @@ -12,3 +12,5 @@ export const assertNoPendingTransactions = async (req, res, next) => {

next();
};

module.exports = { assertNoPendingTransactions };
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "climate-tokenization-engine",
"version": "1.3.8",
"version": "1.3.9",
"bin": "./server.js",
"description": "",
"main": "proxy.js",
Expand Down
3 changes: 1 addition & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -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: {
Expand Down
Loading