Skip to content
This repository has been archived by the owner on Mar 22, 2020. It is now read-only.

Better struct generation for ETH2 spec tests #8

Merged
merged 14 commits into from
Jun 18, 2019
Merged

Conversation

prestonvanloon
Copy link
Member

@prestonvanloon prestonvanloon commented Jun 17, 2019

Two tools here:

  • A tool to create the nuanced structs specifically for use with Ethereum 2.0 spec tests
  • Another tool to overwrite all of the hex encoded strings in the yaml and print out the new yaml.
# To generate go structs, first build the appropriate binary file
bazel build //:yaml-to-go-binary
# use that newly created binary to read your yaml file and write a new go file
dist/bin/yaml-to-go-binary path/to/data.yaml StructName
# now you have structname.yaml.go 

# To format the yaml in a proper format for encoding/json to use
bazel build //yaml-hex-to-base64
# And use that tool to print the formatted yaml, and pipe to new file
dist/bin/yaml-hex-to-base64/yaml-hex-to-base64 path/to/data.yaml > path/to/formatted.yaml

@prestonvanloon prestonvanloon changed the title WIP - Better struct generation for ETH2 spec tests Better struct generation for ETH2 spec tests Jun 17, 2019
@prestonvanloon prestonvanloon marked this pull request as ready for review June 17, 2019 22:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant