mirror of
https://github.com/logos-messaging/logos-messaging-js.git
synced 2026-05-18 10:39:28 +00:00
chore: estimate gas
This commit is contained in:
parent
e5ef13472c
commit
e5a52d0a9c
@ -432,9 +432,15 @@ export class RLNBaseContract {
|
|||||||
idCommitmentBigInt: bigint,
|
idCommitmentBigInt: bigint,
|
||||||
eraseFromMembershipSet: boolean = true
|
eraseFromMembershipSet: boolean = true
|
||||||
): Promise<ethers.ContractTransaction> {
|
): Promise<ethers.ContractTransaction> {
|
||||||
|
const estimatedGas = await this.contract.estimateGas[
|
||||||
|
"eraseMemberships(uint256[],bool)"
|
||||||
|
]([idCommitmentBigInt], eraseFromMembershipSet);
|
||||||
|
const gasLimit = estimatedGas.add(10000);
|
||||||
|
|
||||||
const tx = await this.contract["eraseMemberships(uint256[],bool)"](
|
const tx = await this.contract["eraseMemberships(uint256[],bool)"](
|
||||||
[idCommitmentBigInt],
|
[idCommitmentBigInt],
|
||||||
eraseFromMembershipSet
|
eraseFromMembershipSet,
|
||||||
|
{ gasLimit }
|
||||||
);
|
);
|
||||||
await tx.wait();
|
await tx.wait();
|
||||||
return tx;
|
return tx;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user