thirdweb-dev / engine

The most powerful backend engine for web3 apps.
https://thirdweb.com/engine
Apache License 2.0
152 stars 59 forks source link

chore: toSerializableTransaction function for gas estimation #652

Closed d4mr closed 1 month ago

d4mr commented 1 month ago

PR-Codex overview

The focus of this PR is to refactor transaction handling logic by introducing a new function getPopulatedOrErroredTransaction.

Detailed summary

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

d4mr commented 1 month ago

@arcoraven should we try-catch-rethrow an easier to understand error?

arcoraven commented 1 month ago

This will populate the transaction even on resends. The resend doesn't use it though, so while correct it's just an unneeded call. Maybe it's cleaner to just have a helper func getPopulatedTransaction() and call it from both _sendUserOp() and _sendTransaction() instead?