Skip to content

Commit

Permalink
feat: PreGenesis now takes the chain instead of the chainconfig (#1181)
Browse files Browse the repository at this point in the history
This allows for more dynamic PreGenesis actions, in particular running
custom commands on validators. Users should be aware that the chain
they're receiving isn't started
  • Loading branch information
fastfadingviolets authored Jul 18, 2024
1 parent a3dfdd3 commit 77d9ca2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion chain/cosmos/cosmos_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ func (c *CosmosChain) Start(testName string, ctx context.Context, additionalGene
}

if c.cfg.PreGenesis != nil {
err := c.cfg.PreGenesis(chainCfg)
err := c.cfg.PreGenesis(c)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion chain/cosmos/ics.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ func (c *CosmosChain) StartConsumer(testName string, ctx context.Context, additi
}

if c.cfg.PreGenesis != nil {
err := c.cfg.PreGenesis(chainCfg)
err := c.cfg.PreGenesis(c)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion ibc/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type ChainConfig struct {
// When true, will skip validator gentx flow
SkipGenTx bool
// When provided, will run before performing gentx and genesis file creation steps for validators.
PreGenesis func(ChainConfig) error
PreGenesis func(Chain) error
// When provided, genesis file contents will be altered before sharing for genesis.
ModifyGenesis func(ChainConfig, []byte) ([]byte, error)
// Modify genesis-amounts for the validator at the given index
Expand Down

0 comments on commit 77d9ca2

Please sign in to comment.