You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gnd(test): Document lowercase hex requirement for assertions
graph-node returns all hex-encoded values (addresses, tx hashes, bytes)
in lowercase. Add a note in the Assertions section's comparison behavior
table and in Tips & Best Practices.
Event inputs are normalised automatically and can be mixed case.
Also fix the transfer.json fixture assertion to use lowercase token ID.
| String vs Number | Coerced — `"123"` matches `123`|
385
385
| Nulls/Booleans | Strict equality |
386
+
| Hex strings |**Must be lowercase** — graph-node returns all hex values in lowercase |
386
387
387
-
**Important:** Arrays are compared as sets (order doesn't matter). If you need ordered results, use `orderBy` in your GraphQL query:
388
+
**Important:** Arrays are compared as sets (order doesn't matter).
389
+
390
+
**Important:** graph-node returns all hex-encoded values (addresses, transaction hashes, byte arrays) in **lowercase**. Expected values in assertions must match exactly — mixed-case hex will not match:
"to": "0xBBBB000000000000000000000000000000000000"// ❌ will not match
398
+
}
399
+
}
400
+
}
401
+
```
402
+
403
+
Note: hex values in event inputs (`params`, `address`) are normalized automatically and can be mixed case. If you need ordered results, use `orderBy` in your GraphQL query:
388
404
389
405
```json
390
406
{
@@ -592,23 +608,33 @@ my-subgraph/
592
608
593
609
## Tips & Best Practices
594
610
595
-
### Use Lowercase Addresses
611
+
### Use Lowercase Hex in Assertions
596
612
597
-
Always use lowercase hexaddresses with `0x` prefix:
613
+
graph-node returns **all** hex-encoded values in lowercase — addresses, transaction hashes, and any `Bytes`/`ID` fields. Expected values in assertions must use lowercase hex:
0 commit comments