fix: response

This commit is contained in:
Danil Kovtonyuk 2021-09-14 01:50:52 +10:00 committed by 0xZick
parent 2cf40019e0
commit b95848c829
2 changed files with 6 additions and 3 deletions

View File

@ -26,7 +26,7 @@ export class ApiController {
return res.status(HttpStatus.BAD_REQUEST).json({ error: "The job doesn't exist" }); return res.status(HttpStatus.BAD_REQUEST).json({ error: "The job doesn't exist" });
} }
return job; return res.json(job);
} }
@Post('/transaction') @Post('/transaction')
@ -38,6 +38,8 @@ export class ApiController {
return res.status(HttpStatus.BAD_REQUEST).json({ error: inputError }); return res.status(HttpStatus.BAD_REQUEST).json({ error: inputError });
} }
return await this.service.transaction(JSON.parse(body)); const jobId = await this.service.transaction(JSON.parse(body));
return res.send(jobId);
} }
} }

View File

@ -30,6 +30,7 @@ export type ArgsProof = {
inputNullifiers: string[]; inputNullifiers: string[];
outputCommitments: BytesLike[]; outputCommitments: BytesLike[];
outPathIndices: string; outPathIndices: string;
publicAmount: string;
extDataHash: string; extDataHash: string;
}; };
@ -134,7 +135,7 @@ export class TransactionProcessor extends BaseProcessor<Transaction> {
data, data,
gasLimit, gasLimit,
to: contract.address, to: contract.address,
gasPrice: fast.toString(), gasPrice: toWei(fast.toString(), 'gwei'),
value: BigNumber.from(0)._hex, value: BigNumber.from(0)._hex,
}; };
} }