Skip to content

Commit

Permalink
Commented wait during deposit (#73)
Browse files Browse the repository at this point in the history
* Commented wait during deposit

* Changed package version
  • Loading branch information
ch4r10t33r authored Mar 16, 2024
1 parent 93e4f8f commit d956fe4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion admin_frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "admin_frontend",
"version": "1.0.3",
"version": "1.1.5",
"private": true,
"dependencies": {
"@emotion/react": "11.11.3",
Expand Down
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
3 changes: 2 additions & 1 deletion backend/src/paymaster/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
};
Expand Down
10 changes: 5 additions & 5 deletions backend/src/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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];
Expand Down
3 changes: 2 additions & 1 deletion backend/src/utils/common.ts
Original file line number Diff line number Diff line change
@@ -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: ");
}
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit d956fe4

Please sign in to comment.