Closed m-Peter closed 2 months ago
The changes involve significant modifications to event decoding, testing, and block event handling processes within the codebase. Enhancements include improved validation of EVM block events, the introduction of new test cases for handling missing transactions, and refinements in the construction of blocks and transactions to ensure accurate data representation. Additionally, new error handling mechanisms and improved accessibility of mock client functions have been implemented.
Files | Change Summary |
---|---|
models/events.go | Enhanced decodeCadenceEvents function with validation for EVM block events, ensuring all transactions are accounted for. |
models/events_test.go | Added TestCadenceEvents_Block to validate behavior with missing transactions; renamed hashes to txHashes for clarity. |
services/ingestion/engine_test.go | Modified newBlock to compute TransactionHashRoot and updated newTransaction to decode hex strings into transaction objects. |
services/ingestion/subscriber.go | Added fetchBlockEvents method to RPCSubscriber for improved block event handling and error management. |
services/ingestion/subscriber_test.go | Introduced tests for subscription behavior with error handling and retry logic. |
services/testutils/mock_client.go | Renamed function fields in MockClient to uppercase for export, enhancing accessibility from outside the package. |
sequenceDiagram
participant User
participant EventDecoder
participant TransactionManager
participant BlockManager
participant RPCSubscriber
User->>EventDecoder: Trigger event decoding
EventDecoder->>BlockManager: Validate block and transactions
BlockManager->>TransactionManager: Retrieve transaction hashes
TransactionManager-->>BlockManager: Return transaction hashes
BlockManager-->>EventDecoder: Validate transaction hash root
EventDecoder-->>User: Return decoded events or error
User->>RPCSubscriber: Request block events
RPCSubscriber->>BlockManager: Fetch block events
BlockManager-->>RPCSubscriber: Return block events or error
RPCSubscriber-->>User: Provide block events or error message
🐰 In the meadow, hops a little hare,
With changes made, there's joy to share!
Blocks and transactions, all in a row,
Validations strong, watch them glow!
A test for each hop, a dance so bright,
Celebrating code, oh what a delight! 🌼
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?
Description
For contributor use:
master
branchFiles changed
in the Github PR explorerSummary by CodeRabbit
New Features
Bug Fixes
Refactor