Skip to content

Commit

Permalink
[api] Remove duplicate memoize on estimate gas price
Browse files Browse the repository at this point in the history
  • Loading branch information
gregnazario committed Oct 11, 2023
1 parent 216d054 commit 6953235
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/api/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
} from "../internal/transaction";
import { AnyNumber, GasEstimation, HexInput, PaginationArgs, TransactionResponse } from "../types";
import { AptosConfig } from "./aptos_config";
import { memoizeAsync } from "../utils/memoize";

export class Transaction {
readonly config: AptosConfig;
Expand Down Expand Up @@ -130,14 +129,9 @@ export class Transaction {
* ```
*/
async getGasPriceEstimation(): Promise<GasEstimation> {
const gasEstimation = await memoizeAsync(
async () =>
getGasPriceEstimation({
aptosConfig: this.config,
}),
`gas-price-${this.config.network}`,
1000 * 60 * 5, // 5 minutes
)();
const gasEstimation = getGasPriceEstimation({
aptosConfig: this.config,
});
return gasEstimation;
}
}

0 comments on commit 6953235

Please sign in to comment.