refactor(starknet): replace BlockStatus string with typed enum#3779
refactor(starknet): replace BlockStatus string with typed enum#37790xsamalt wants to merge 1 commit into
Conversation
0xsamalt
commented
Jul 1, 2026
- Introduces BlockStatus as a typed uint8 enum in starknet/block.go with constants BlockPending, BlockAcceptedOnL1, BlockAcceptedOnL2, BlockRejected, and BlockPreConfirmed
- Adds UnmarshalText so the feeder JSON response deserialises directly into the enum and invalid status strings now return an error
- Updates all comparison sites and test assertions to use the typed constants
c2f22d1 to
f3415d0
Compare
|
Nice one, typed status is much better than a bare string 👍 One thing I'd double-check first though: So if the feeder ever sends something not in the list (pretty sure Wdyt about mapping unknown values to a |