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: waitForTransactionReceipt proper eth_call usage #4339

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore: tweaks
tmm committed Nov 5, 2024

Verified

This commit was signed with the committer’s verified signature.
tmm awkweb
commit d217bf0397f883923c6886fae74d97fa3452e632
2 changes: 1 addition & 1 deletion .changeset/red-trains-switch.md
Original file line number Diff line number Diff line change
@@ -2,4 +2,4 @@
"@wagmi/core": patch
---

Fixed bug in waitForTransactionReceipt where transaction data wasn't passed to eth_call method
Fixed bug in `waitForTransactionReceipt`, where transaction data wasn't passed to `'eth_call'` method as part of getting the revert reason.
3 changes: 1 addition & 2 deletions packages/core/src/actions/waitForTransactionReceipt.ts
Original file line number Diff line number Diff line change
@@ -67,13 +67,12 @@ export async function waitForTransactionReceipt<
const action_call = getAction(client, call, 'call')
const code = await action_call({
...(txn as any),
data: txn.input,
gasPrice: txn.type !== 'eip1559' ? txn.gasPrice : undefined,
maxFeePerGas: txn.type === 'eip1559' ? txn.maxFeePerGas : undefined,
maxPriorityFeePerGas:
txn.type === 'eip1559' ? txn.maxPriorityFeePerGas : undefined,
data: txn.input ? txn.input : undefined,
})

const reason = code?.data
? hexToString(`0x${code.data.substring(138)}`)
: 'unknown reason'