-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/live 15551 aptos refactor cache for get estimated gas #8848
base: develop
Are you sure you want to change the base?
Feat/live 15551 aptos refactor cache for get estimated gas #8848
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ
3 Skipped Deployments
|
libs/ledger-live-common/src/families/aptos/getFeesForTransaction.ts
Outdated
Show resolved
Hide resolved
libs/ledger-live-common/src/families/aptos/getFeesForTransaction.ts
Outdated
Show resolved
Hide resolved
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
|
||
if (!CACHE.has(key)) { | ||
CACHE.set(key, await getFee(account, transaction, aptosClient)); | ||
if (!CACHE.amount.eq(transaction.amount)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hedi-edelbloute does makeLRUCache removes the need for the CACHE?
c362c13
to
aad4ecf
Compare
@@ -64,10 +64,8 @@ const aptos: CurrenciesData<Transaction> = { | |||
family: "aptos", | |||
mode: "send", | |||
fees: "1100", | |||
options: '{ "maxGasAmount": "11", "gasUnitPrice": "100" }', | |||
estimate: | |||
options: | |||
'{ "maxGasAmount": "11", "gasUnitPrice": "100", "sequenceNumber": "1", "expirationTimestampSecs": "1734535375" }', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wasn't sequenceNumber
and expirationTimestampSecs
removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a good point. If it was removed, how did it not failed? π€
d35af06
to
d2fbe96
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check my latest comments
"SequenceNumberError": { | ||
"title": "Sequence number error", | ||
"description": "Please close the window and try again later" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be removed also?
@@ -415,7 +411,6 @@ describe("Aptos API", () => { | |||
options: { | |||
maxGasAmount: Number(options.maxGasAmount), | |||
gasUnitPrice: Number(options.gasUnitPrice), | |||
accountSequenceNumber: Number(options.sequenceNumber), | |||
expireTimestamp: 120, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this line? ---> expireTimestamp: 120,
expect(result).toEqual(expected); | ||
}); | ||
}); | ||
|
||
describe("with vm_status as INSUFFICIENT_BALANCE", () => { | ||
it("should return a fee estimation object", async () => { | ||
simulateTransaction = jest.fn(() => [ | ||
{ | ||
success: false, | ||
vm_status: ["INSUFFICIENT_BALANCE"], | ||
expiration_timestamp_secs: 5, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we keep this line?
β Checklist
npx changeset
was attached.π Description
The cache for transaction fees was broken, and after the removal of the advanced transaction settings, there is unnecessary logic and structures remaining in the code.
Issues that were resolved:
gasPrice
,gasAmount
).β Context
π§ Checklist for the PR Reviewers