Skip to content

Commit

Permalink
Revert temporary fix gas estimation (#251)
Browse files Browse the repository at this point in the history
* remove fixed gas estimation value

* add changeset
  • Loading branch information
mmaurello authored May 13, 2024
1 parent 5ee5a75 commit a883833
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/fresh-turkeys-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@moonbeam-network/xcm-sdk': patch
---

Remove fixed gas estimation value
7 changes: 1 addition & 6 deletions packages/sdk/src/contract/contracts/Xtokens/Xtokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,15 @@ export class Xtokens implements TransferContractInterface {
return contract[this.#config.func].estimateGas(...this.#config.args);
}

// eslint-disable-next-line class-methods-use-this
async getViemContractEstimatedGas(
contract: XtokensContract,
): Promise<bigint> {
if (!contract) {
return 0n;
}

// Temporary fix to Module(ModuleError { index: 51, error: [0, 0, 0, 0], message: None })
// To be reverted next week when Moonbeam is in RT2900
return 100000n;

// eslint-disable-next-line @typescript-eslint/no-explicit-any
// return contract.estimateGas[this.#config.func](this.#config.args as any);
return contract.estimateGas[this.#config.func](this.#config.args as any);
}

async getFee(amount: bigint): Promise<bigint> {
Expand Down

0 comments on commit a883833

Please sign in to comment.