Commit 01e6b28
committed
feat: automate type generation with append-only version log
Replace hand-maintained src/types/ with auto-generated types from
Subsquid typegen, seeded from all TFChain networks (devnet, qanet,
testnet, mainnet). JSONL sorted by specVersion so typegen assigns
the lowest version label for each unique event hash.
Infrastructure:
- Add scripts/merge-versions.js: append-only JSONL merger, sorted output
- Add scripts/seed-versions.sh: multi-network metadata discovery
(order: devnet -> qanet -> testnet -> mainnet)
- Seed typegen/tfchainVersions.jsonl with 93 specVersions from all networks
- Update typegen/typegen.json: output directly to src/types/, add 3 events
to config that were used by processor but missing from typegen config
(FarmCertificationSet, NodeCertificationSet, FarmingPolicyUpdated)
- Add Makefile targets: typegen, typegen-seed, typegen-add
- Rewrite docs/typeChanges.md with automated workflow, deployment order,
resync guidance, and notes on typesBundle.json being frozen
Type generation:
- Regenerate src/types/ from chain metadata (correct hashes)
- Remove src/typesDevelopment/ (no longer needed)
- Remove src/types/context.ts (unused)
Mapping renames (all verified: identical hashes and type structures):
- V49 -> V9: FarmDeleted, FarmPayoutV2, NodeDeleted, NodeUptimeReported,
TwinDeleted, TwinStored, TwinUpdated, PricingPolicyStored
- V49 -> V19: NodeContractCanceled, NameContractCanceled, PriceStored
- V49 -> V12: NodePublicConfigStored
- V101 -> V63: FarmStored, FarmUpdated, NodeStored, NodeUpdated
- V122 -> V123: All ServiceContract events
- V124 -> V125: TwinStored, TwinUpdated
- V134 -> V140: NodeExtraFeeSet
- Removed dead branches with phantom hashes from wrong field ordering
(FarmStored/Updated V63, NodeStored/Updated V63, TwinStored/Updated V49)
- Removed unused v63 import from farms.ts1 parent 0095208 commit 01e6b28
36 files changed
Lines changed: 1101 additions & 1110 deletions
File tree
- docs
- scripts
- src
- mappings
- types
- typegen
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
0 commit comments