Open
Conversation
Build mock receipts from block events and attach them to log triggers. Events sharing the same txHash share a receipt whose logs contains all their logs in declaration order; events without an explicit txHash each get a unique auto-generated hash and their own single-log receipt. Receipts are only attached to logs whose event selector (topic0) matches a handler that declares receipt: true in the manifest, mirroring production behaviour where graph-node only fetches receipts from the RPC for those handlers. The selector is computed using the same normalisation as graph-node's MappingEventHandler::topic0() to handle the manifest's indexed-before-type convention (e.g. Transfer(indexed address,...)). Most receipt fields (gas, from, to, status) are hardcoded stubs; only receipt.logs reflects the actual test data.
Replaces the dummy IpfsRpcClient with a MockIpfsClient that serves pre-loaded CID → bytes from a "files" array in test JSON files. Missing CIDs are reported with a clear error instead of a 60-second timeout. Also adds IpfsResponse::for_test() helper and documents the unmocked eth_call timeout in the troubleshooting guide.
Introduces `MockArweaveResolver` and the `arweaveFiles` schema field so `gnd test` can serve pre-loaded Arweave content without hitting the network. Unresolved tx IDs are collected and reported as a clear test failure, mirroring the existing IPFS mock behaviour.
Add IPFS and Arweave file data source test fixtures and split the monolithic gnd_test fixture into four focused subgraphs: - token/ ERC20 events, eth_call mocking, dynamic templates - blocks/ Block handlers (every, once, polling filters) - receipts/ Transaction receipts (receipt: true handlers) - file-data-sources/ IPFS and Arweave file data sources Each fixture is a standalone subgraph with its own schema, mappings, ABIs, and test JSON files. The Rust test harness is updated to use a generic setup_fixture(name) helper, with one test function per fixture.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces improvements and new features to the
gnd testframework:receipt.logsis now populated and grouped bytxHash, while other fields are hardcoded stubs. Handlers withoutreceipt: truecontinue to receivenullreceipts. Documentation details grouping rules and limitations.MockIpfsClientandMockArweaveResolverimplementations, allowing tests to pre-load mock file data and report missing CIDs or txIds as clear failures after sync.Documentation and Troubleshooting
eth_call, including symptoms, fixes, and plans for future improvements.