Skip to content

Commit

Permalink
remove isNeededForTx being returned by gas estimation (#3386)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonator authored Jun 20, 2024
1 parent 1473397 commit fc6f9d3
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/stores/src/account/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ export class AccountStore<Injects extends Record<string, any>[] = []> {
messages: readonly EncodeObject[];
initialFee?: Optional<StdFee, "gas">;
signOptions?: SignOptions;
}): Promise<QuoteStdFee> {
}): Promise<StdFee> {
if (!wallet.address) throw new Error("No wallet address available.");

try {
Expand Down Expand Up @@ -1295,7 +1295,17 @@ export class AccountStore<Injects extends Record<string, any>[] = []> {
};
}

return estimate;
// avoid returning isNeededForTx, a utility returned from the estimateGasFee function that is not used here
// Also, for now, only single-token fee payments are supported.
return {
gas: estimate.gas,
amount: [
{
denom: estimate.amount[0].denom,
amount: estimate.amount[0].amount,
},
],
};
} catch (e) {
if (e instanceof ApiClientError) {
const apiClientError = e as ApiClientError<{
Expand Down

0 comments on commit fc6f9d3

Please sign in to comment.