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

Use a chain config for testing package chain setup #3601

Open
3 tasks
colin-axner opened this issue May 17, 2023 · 1 comment
Open
3 tasks

Use a chain config for testing package chain setup #3601

colin-axner opened this issue May 17, 2023 · 1 comment
Labels
change: api breaking Issues or PRs that break Go API (need to be release in a new major version) needs discussion Issues that need discussion before they can be worked on testing Testing package and unit/integration tests

Comments

@colin-axner
Copy link
Contributor

Summary

Add a new ChainConfig struct to create custom testing chains

Problem Definition

The testing pkg originally was intended for internal usage, but quickly external developers forked ibc-go to access the testing pkg. It was then redesigned and extended to allow app developer to make use of the package. They can do this by overiding the DefaultTestingAppInit variable in the testing package. The intention was that this would only need to be overriden once.

With more complex workflows, we see app developers wanting to run the testing pkg against two chains configured with different app.go's. See #3286

Proposal

Create a ChainConfig struct:

type ChainConfig struct {                                          
    chainID  string                                              
    appSetup func() (TestingApp, map[string]json.RawMessage)   
}    

This can then be used in NewCoordinator and eventually passed down into SetupWithGenesisValSet. This avoids using a global and allows for a cleaner API as the NewCoordinator call may look like this:

ibctesting.NewCoordinator(t, []ibctesting.ChainConfig{gaiaChainConfig, osmosisChainConfig})

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged/assigned
@colin-axner colin-axner added the needs discussion Issues that need discussion before they can be worked on label May 17, 2023
@colin-axner
Copy link
Contributor Author

colin-axner commented Jul 4, 2023

May or may not be useful if we remove the coordinator, we can revisit after the majority of the testing pkg improvements are in place. Maybe we could provide the config to NewTestChain instead

@colin-axner colin-axner moved this to On hold in ibc-go Jul 4, 2023
@colin-axner colin-axner added the testing Testing package and unit/integration tests label Jul 4, 2023
@colin-axner colin-axner added the change: api breaking Issues or PRs that break Go API (need to be release in a new major version) label Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change: api breaking Issues or PRs that break Go API (need to be release in a new major version) needs discussion Issues that need discussion before they can be worked on testing Testing package and unit/integration tests
Projects
Status: On hold ❌
Development

No branches or pull requests

1 participant