Skip to content

Commit 5b60c17

Browse files
gnd: Fix missing fields, update readme
Signed-off-by: Maksim Dimitrov <dimitrov.maksim@gmail.com>
1 parent 59b74d4 commit 5b60c17

File tree

2 files changed

+5
-25
lines changed

2 files changed

+5
-25
lines changed

gnd/src/commands/test/README.md

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ my-subgraph/
582582
| Log events | ✅ Supported |
583583
| Block handlers (all filters) | ✅ Supported |
584584
| eth_call mocking | ✅ Supported |
585-
| Dynamic/template data sources | ✅ Supported (via graph-node) |
585+
| Dynamic/template data sources | (Untested)
586586
| Transaction receipts (`receipt: true`) | ❌ Not implemented — handlers get `null` |
587587
| File data sources / IPFS mocking | ❌ Not implemented |
588588
| Call triggers (traces) | ❌ Not implemented |
@@ -655,30 +655,6 @@ Use empty blocks to test that block handlers fire even without events:
655655
}
656656
```
657657

658-
### Testing Polling Handlers
659-
660-
When testing polling handlers, include enough blocks to verify the interval:
661-
662-
```json
663-
// ✅ Good - tests multiple intervals
664-
{
665-
"name": "Polling every 3 blocks",
666-
"blocks": [{}, {}, {}, {}, {}, {}, {}], // Blocks 0-6, handler fires at 0, 3, 6
667-
"assertions": [...]
668-
}
669-
```
670-
671-
```json
672-
// ❌ Insufficient - only one firing
673-
{
674-
"name": "Polling every 3 blocks",
675-
"blocks": [{}], // Only block 0 - can't verify interval
676-
"assertions": [...]
677-
}
678-
```
679-
680-
**Remember:** Polling handlers fire at `startBlock + (N × every)` where N = 0, 1, 2, ...
681-
682658
### Split Complex Tests
683659

684660
Instead of one large test with many blocks, split into multiple focused test files:

gnd/src/validation/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,8 @@ type Post @entity {
11811181
abis: vec![],
11821182
source_address: None,
11831183
source_abi: None,
1184+
start_block: 0,
1185+
end_block: None,
11841186
event_handlers: vec![],
11851187
call_handlers: vec![],
11861188
block_handlers: vec![],
@@ -1197,6 +1199,8 @@ type Post @entity {
11971199
abis: vec![],
11981200
source_address: Some(address.to_string()),
11991201
source_abi: None,
1202+
start_block: 0,
1203+
end_block: None,
12001204
event_handlers: vec![],
12011205
call_handlers: vec![],
12021206
block_handlers: vec![],

0 commit comments

Comments
 (0)