From 0b7ea8cd63ea69e1f5107e538a95c48c2822e254 Mon Sep 17 00:00:00 2001 From: ch4r10t33r Date: Sat, 16 Mar 2024 13:19:24 +0000 Subject: [PATCH 1/2] Commented wait during deposit --- backend/src/paymaster/index.ts | 3 ++- backend/src/routes/index.ts | 10 +++++----- backend/src/utils/common.ts | 3 ++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/backend/src/paymaster/index.ts b/backend/src/paymaster/index.ts index a69a27d..066a1ca 100644 --- a/backend/src/paymaster/index.ts +++ b/backend/src/paymaster/index.ts @@ -164,7 +164,8 @@ export class Paymaster { throw new Error(`${signer.address} Balance is less than the amount to be deposited`) const encodedData = paymasterContract.interface.encodeFunctionData('depositFunds', []); const tx = await signer.sendTransaction({ to: paymasterAddress, data: encodedData, value: ethers.utils.parseEther(amount.toString()) }); - await tx.wait(); + // commented the below line to avoid timeouts for long delays in transaction confirmation. + // await tx.wait(); return { message: `Successfully deposited with transaction Hash ${tx.hash}` }; diff --git a/backend/src/routes/index.ts b/backend/src/routes/index.ts index dbc4709..b7f503f 100644 --- a/backend/src/routes/index.ts +++ b/backend/src/routes/index.ts @@ -58,7 +58,7 @@ const routes: FastifyPluginAsync = async (server) => { "/", async function (request, reply) { try { - printRequest(request, server.log); + printRequest("/", request, server.log); const query: any = request.query; const body: any = request.body; if (!body) return reply.code(ReturnCode.FAILURE).send({ error: ErrorMessage.EMPTY_BODY }); @@ -188,7 +188,7 @@ const routes: FastifyPluginAsync = async (server) => { whitelistResponseSchema, async function (request, reply) { try { - printRequest(request, server.log); + printRequest("/pimlicoAddress", request, server.log); const query: any = request.query; const body: any = request.body; const entryPoint = body.params[0]; @@ -263,7 +263,7 @@ const routes: FastifyPluginAsync = async (server) => { "/whitelist", async function (request, reply) { try { - printRequest(request, server.log); + printRequest("/whiteList",request, server.log); const body: any = request.body; const query: any = request.query; const address = body.params[0]; @@ -379,7 +379,7 @@ const routes: FastifyPluginAsync = async (server) => { "/checkWhitelist", async function (request, reply) { try { - printRequest(request, server.log); + printRequest("/checkWhiteList", request, server.log); const body: any = request.body; const query: any = request.query; const accountAddress = body.params[0]; @@ -438,7 +438,7 @@ const routes: FastifyPluginAsync = async (server) => { whitelistResponseSchema, async function (request, reply) { try { - printRequest(request, server.log); + printRequest("/deposit", request, server.log); const body: any = request.body; const query: any = request.query; const amount = body.params[0]; diff --git a/backend/src/utils/common.ts b/backend/src/utils/common.ts index 28e1b68..9cf0915 100644 --- a/backend/src/utils/common.ts +++ b/backend/src/utils/common.ts @@ -1,6 +1,7 @@ import { FastifyBaseLogger, FastifyRequest } from "fastify"; -export function printRequest(request: FastifyRequest, log: FastifyBaseLogger) { +export function printRequest(methodName: string, request: FastifyRequest, log: FastifyBaseLogger) { + log.info(methodName, "called: "); log.info(request.query, "query passed: "); log.info(request.body, "body passed: "); } From fff1c9ac325105619907aaa9123a4adb688472ea Mon Sep 17 00:00:00 2001 From: ch4r10t33r Date: Sat, 16 Mar 2024 13:28:39 +0000 Subject: [PATCH 2/2] Changed package version --- admin_frontend/package.json | 2 +- backend/package.json | 2 +- frontend/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/admin_frontend/package.json b/admin_frontend/package.json index 9c9f593..a99ede5 100644 --- a/admin_frontend/package.json +++ b/admin_frontend/package.json @@ -1,6 +1,6 @@ { "name": "admin_frontend", - "version": "1.0.3", + "version": "1.1.5", "private": true, "dependencies": { "@emotion/react": "11.11.3", diff --git a/backend/package.json b/backend/package.json index e798943..dc95b85 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "arka", - "version": "1.1.4", + "version": "1.1.5", "description": "ARKA - (Albanian for Cashier's case) is the first open source Paymaster as a service software", "type": "module", "directories": { diff --git a/frontend/package.json b/frontend/package.json index 065d6bf..6dcdc9f 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "arka_frontend", - "version": "1.0.3", + "version": "1.1.5", "private": true, "dependencies": { "@babel/plugin-proposal-private-property-in-object": "7.21.11",