Skip to content

Commit

Permalink
Merge pull request #3 from 0xPolygonID/fix/calculate-gas
Browse files Browse the repository at this point in the history
calculate transaction gas limit
  • Loading branch information
ilya-korotya authored Nov 11, 2024
2 parents 581d389 + 7b6adda commit b27732c
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions client/src/services/onchainIssuer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,21 @@ export const issueCredential = async (
try {
const gasPrice = await web3.eth.getGasPrice();
const priorityGasPrice = (gasPrice * BigInt(150)) / BigInt(100);
const gasLimit = await onchainNonMerklizedIssuer.methods.issueCredential(userId.bigInt()).estimateGas({ from });
const increasedGasLimit = gasLimit * BigInt(120) / BigInt(100);
const gasLimit = await onchainNonMerklizedIssuer.methods.issueCredential(
userId.bigInt(),
nullifierSeed,
anonAadhaarProof.nullifier,
anonAadhaarProof.timestamp,
from,
[
anonAadhaarProof.ageAbove18,
anonAadhaarProof.gender,
anonAadhaarProof.pincode,
anonAadhaarProof.state,
],
packedGroth16Proof
).estimateGas({ from });
const increasedGasLimit = gasLimit * BigInt(130) / BigInt(100);

await onchainNonMerklizedIssuer.methods
.issueCredential(
Expand Down

0 comments on commit b27732c

Please sign in to comment.