Closed m-Peter closed 2 months ago
The changes consolidate the decoding process of EVM.TransactionExecuted
events in the system. Previously, decoding the transaction and receipt was done separately, causing redundancy. Now, the decodeTransactionEvent
function handles both tasks, streamlining the process and improving efficiency. The changes affect multiple files, primarily within the models, adjusting function signatures and import statements accordingly.
File Path | Change Summary |
---|---|
models/events.go | Updated Transactions method to use decodeTransactionEvent for combined decoding of transactions and receipts. |
models/receipt.go | Removed redundant imports and the decodeReceipt function related to receipt decoding. |
models/transaction.go | Refactored decodeTransaction to decodeTransactionEvent , updating the decoding logic and error handling. |
models/receipt_test.go | Updated tests to reflect the new return values of decodeTransactionEvent . |
models/transaction_test.go | Modified test functions to accommodate changes in decodeTransactionEvent return values. |
sequenceDiagram
participant C as CadenceEvents
participant D as Decoder
participant T as Transaction
participant R as StorageReceipt
C->>D: Transactions()
loop for each event
D->>D: decodeTransactionEvent(e.Value)
D->>C: Transaction, Receipt
C->>T: Add Transaction
C->>R: Add Receipt
end
Objective | Addressed | Explanation |
---|---|---|
Consolidate decoding of transaction and receipt from EVM.TransactionExecuted event (#349) |
✅ |
In the code where data flows, Decoding twice now overthrows, With
decodeTransactionEvent
in place, We've streamlined logic, saved some space. Transactions and receipts in one go, Efficiency and clarity, watch them grow! 🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Closes: https://github.com/onflow/flow-evm-gateway/issues/349
Description
The
decodeTransactionEvent
now decodes the givenEVM.TransactionExecuted
event, and returns both aTransaction
and aStorageReceipt
object.For contributor use:
master
branchFiles changed
in the Github PR explorerSummary by CodeRabbit
Refactor
Tests