Skip to content

Commit

Permalink
Merge pull request #1405 from CosmWasm/ibc_testing_coord
Browse files Browse the repository at this point in the history
Extend ibctesting coordinator
  • Loading branch information
alpe authored May 16, 2023
2 parents f6a3534 + 4cde99f commit f3f69a6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions x/wasm/ibctesting/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ type Coordinator struct {
Chains map[string]*TestChain
}

// NewCoordinator initializes Coordinator with N TestChain's
// NewCoordinator initializes Coordinator with n default wasm TestChain instances
func NewCoordinator(t *testing.T, n int, opts ...[]wasmkeeper.Option) *Coordinator {
return NewCoordinatorX(t, n, DefaultWasmAppFactory, opts...)
}

// NewCoordinatorX initializes Coordinator with N TestChain instances using the given app factory
func NewCoordinatorX(t *testing.T, n int, appFactory ChainAppFactory, opts ...[]wasmkeeper.Option) *Coordinator {
chains := make(map[string]*TestChain)
coord := &Coordinator{
t: t,
Expand All @@ -42,7 +47,7 @@ func NewCoordinator(t *testing.T, n int, opts ...[]wasmkeeper.Option) *Coordinat
if len(opts) > (i - 1) {
x = opts[i-1]
}
chains[chainID] = NewDefaultTestChain(t, coord, chainID, x...)
chains[chainID] = NewTestChain(t, coord, appFactory, chainID, x...)
}
coord.Chains = chains

Expand Down

0 comments on commit f3f69a6

Please sign in to comment.