Skip to content
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

Fix Celo maxFeePerGas calculation for fee currency transactions #2811

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

shazarre
Copy link
Contributor

@shazarre shazarre commented Oct 3, 2024

Previously the multiply function was not applied to the base fee returned from the node. This PR fixes that.


PR-Codex overview

This PR focuses on fixing the calculation of maxFeePerGas for fee currency transactions in the Celo network, ensuring accurate gas fee estimations and adjustments in tests.

Detailed summary

  • Updated the calculation of maxFeePerGas in src/celo/fees.ts to use suggestedMaxFeePerGas.
  • Adjusted mock return values for gas price and priority fee in src/celo/fees.test.ts.
  • Changed expected values in the snapshot test for fees.
  • Modified return values for gas price in src/celo/sendTransaction.test.ts.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

changeset-bot bot commented Oct 3, 2024

🦋 Changeset detected

Latest commit: 471a3f8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Oct 3, 2024

@shazarre is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

@jxom jxom merged commit 03df7fb into wevm:main Oct 3, 2024
21 of 34 checks passed
Comment on lines +33 to +34
if (request.method === 'eth_gasPrice') return '15057755162'
if (request.method === 'eth_maxPriorityFeePerGas') return '602286'
Copy link
Contributor

@jeanregisser jeanregisser Oct 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Real requests to these RPC methods return Hex strings.

❯ curl --silent -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":1}' https://forno.celo.org | jq
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x2540be400"
}

I guess here it still works because we parse them with BigInt(value). And Hex strings are accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants