Add enum type support to ABI serialization#10
Merged
Conversation
The block_timestamp epoch was changed from 946684800000 (2000-01-01) to 1735689600000 (2025-01-01) for Wire Network, but the test cases still used pre-2025 dates causing roundtrip mismatches.
Add full enum support matching wire-sysio's abi_serializer behavior. Enums are defined in the ABI with a name, underlying integer type, and named values. The serializer resolves symbolic names to/from integers: - bin_to_json: reads underlying int, outputs symbolic name string (falls back to string number for unknown values) - json_to_bin: accepts symbolic name or integer string, writes as underlying type This fixes Hyperion's "Unknown type: trx_match_type" error when processing blocks containing sysio.system's trx_priority enums. Implementation follows the existing variant_def pattern: - enum_value_def/enum_def structs with SYSIO_REFLECT - might_not_exist<> wrapper in abi_def for backward compatibility - abi_type::enum_ variant with resolve() for type resolution - pseudo_enum serializer with direct binary I/O helpers - Underlying type validated as integer at ABI load time
bearcubsvet
approved these changes
Mar 30, 2026
heifner
added a commit
to Wire-Network/node-abieos
that referenced
this pull request
Mar 30, 2026
Picks up Wire-Network/abieos#10 which adds full enum support to ABI serialization. Fixes Hyperion's "Unknown type: trx_match_type" error when indexing blocks with sysio.system trx_priority enums.
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.
Summary
abi_serializerbehaviorbin_to_jsonoutputs symbolic names ("only","first","any");json_to_binaccepts both names and integer strings"Unknown type: trx_match_type"error when indexing blocks withsysio.systemtrx_priority enumsblock_timestamp_typetest failure (test dates updated for Wire's 2025 epoch)Files changed
include/sysio/abi.hpp—enum_value_def,enum_def,abi_def.enums,abi_type::enum_src/abi.cpp—resolve(), enum registration inconvert(), underlying type validationsrc/abieos.hpp—pseudo_enumserializer,enum_read_int/enum_write_int/enum_parse_valuehelperssrc/test.cpp— enum roundtrip tests, block_timestamp date fixes, fuzzer corpus mapping