Skip to content

Commit

Permalink
calculate priority gas price instead of gas limit
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-korotya committed Sep 5, 2024
1 parent e7ea3dd commit 7f1fa67
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion client/src/services/onchainIssuer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ export const issueCredential = async (contractAddress: string, userId: Id) => {
const from = accounts[0];
const onchainNonMerklizedIssuer = new web3.eth.Contract(contractABI, contractAddress);

await onchainNonMerklizedIssuer.methods.issueCredential(userId.bigInt()).send({ from });
const gasPrice = await web3.eth.getGasPrice();
const priorityGasPrice = gasPrice * BigInt(150) / BigInt(100);

await onchainNonMerklizedIssuer.methods.issueCredential(userId.bigInt()).send({
from,
maxPriorityFeePerGas: priorityGasPrice.toString(),
});
};

export const getUserCredentialIds = async (contractAddress: string, userId: Id): Promise<Array<string>> => {
Expand Down

0 comments on commit 7f1fa67

Please sign in to comment.