ibc-go icon indicating copy to clipboard operation
ibc-go copied to clipboard

Add wrapper type around genesis to handle generic json object

Open chatton opened this issue 11 months ago • 0 comments

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 avatar Mar 20 '24 11:03 chatton