Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suave_structs.go: Marshal bytes to hexstring #206

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jinmel
Copy link
Contributor

@jinmel jinmel commented Feb 23, 2024

  • current: []byte field marshals to base64 string
  • to be: BuildBlockArgs and DataRecord structs now use hexutil.Big and hexutil.Bytes for uint64 and []byte fields respectively

📝 Summary

📚 References


  • I have seen and agree to CONTRIBUTING.md

 - current: []byte field marshals to base64 string
 - to be: BuildBlockArgs and DataRecord structs now use hexutil.Big and hexutil.Bytes for uint64 and []byte fields respectively
@jinmel jinmel marked this pull request as draft February 23, 2024 23:14
@jinmel jinmel marked this pull request as ready for review February 24, 2024 07:42
@@ -243,6 +265,13 @@ type {{.Name}} struct {
{{range .Fields}}{{title .Name}} {{typ3 .Typ}}
{{end}}
}

type {{.Name | lower}}Marshaling struct {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to do this as part of the code generation?

Could you create another file suave_structs_encoding.go which is not code generated that does the encoding overriding?

core/types/suave_structs.go Show resolved Hide resolved
@@ -45,6 +45,11 @@ devtools:

suavedevtools:
go run ./suave/gen/main.go -write
cd core/types && \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants