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

Add wrapper type around genesis to handle generic json object #6033

Open
3 tasks
chatton opened this issue Mar 20, 2024 · 0 comments
Open
3 tasks

Add wrapper type around genesis to handle generic json object #6033

chatton opened this issue Mar 20, 2024 · 0 comments
Labels
e2e needs discussion Issues that need discussion before they can be worked on type: productivity Increase dev productivity and throughput by improving developer tooling, infrastructure, automation

Comments

@chatton
Copy link
Contributor

chatton commented Mar 20, 2024

Summary

A common issue that occurs in our E2E tests is dealing with genesis modifications.

The majority of the logic happens here

Our approach so far, has been to attempt to marshal the bytes into concrete types, modify the types, and serialize back to bytes. Over time, we have run into several categories of problems.

Things get quite complex quite quickly when needing to consider all previous versions and how to handle the genesis bytes.

I think we could consider forgetting about trying to work with concrete types, and creating a wrapper around a simple map[string]interface{}

type GenesisFile map[string]interface{}

And adding a bunch of functions which perform the operations that we need.

I think this is definitely not a perfect solution, but due to the nature of our tests needing to work with all versions, we are effectively working with an unversioned json object, and it might be the lesser of two evils to simply treat it as such.

I think we will still have some of the problems outlined above, such as conditional modifications, but I think this idea is at least worth exploring with a PoC.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged/assigned
@chatton chatton added needs discussion Issues that need discussion before they can be worked on e2e type: refactor Architecture, code or CI improvements that may or may not tackle technical debt. labels Mar 20, 2024
@crodriguezvega crodriguezvega added type: productivity Increase dev productivity and throughput by improving developer tooling, infrastructure, automation and removed type: refactor Architecture, code or CI improvements that may or may not tackle technical debt. labels May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e needs discussion Issues that need discussion before they can be worked on type: productivity Increase dev productivity and throughput by improving developer tooling, infrastructure, automation
Projects
None yet
Development

No branches or pull requests

2 participants