Skip to content

Commit

Permalink
parse propID for VoteOnProposalAllValidators
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups committed May 4, 2024
1 parent f456ced commit f2e746d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
18 changes: 6 additions & 12 deletions chain/cosmos/cosmos_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1120,16 +1120,15 @@ func (c *CosmosChain) StartProvider(testName string, ctx context.Context, additi
return err
}

if err := c.VoteOnProposalAllValidators(ctx, propTx.ProposalID, ProposalVoteYes); err != nil {
return err
}

// propTx.ProposalID
propID, err := strconv.ParseUint(propTx.ProposalID, 10, 64)
if err != nil {
return fmt.Errorf("failed to parse proposal id: %w", err)
}

if err := c.VoteOnProposalAllValidators(ctx, propID, ProposalVoteYes); err != nil {
return err
}

_, err = PollForProposalStatus(ctx, c, height, height+10, propID, govv1beta1.StatusPassed)
if err != nil {
return fmt.Errorf("proposal status did not change to passed in expected number of blocks: %w", err)
Expand Down Expand Up @@ -1538,18 +1537,13 @@ func (c *CosmosChain) StartAllValSidecars(ctx context.Context) error {
return eg.Wait()
}

func (c *CosmosChain) VoteOnProposalAllValidators(ctx context.Context, proposalID string, vote string) error {
propID, err := strconv.ParseUint(proposalID, 10, 64)
if err != nil {
return fmt.Errorf("failed to parse proposalID %s: %w", proposalID, err)
}

func (c *CosmosChain) VoteOnProposalAllValidators(ctx context.Context, proposalID uint64, vote string) error {
var eg errgroup.Group
for _, n := range c.Nodes() {
if n.Validator {
n := n
eg.Go(func() error {
return n.VoteOnProposal(ctx, valKey, propID, vote)
return n.VoteOnProposal(ctx, valKey, proposalID, vote)
})
}
}
Expand Down
3 changes: 1 addition & 2 deletions local-interchain/interchain/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ func StartChain(installDir, chainCfgFile string, ac *types.AppStartConfig) {
// Add Interchain Security chain pairs together
if len(icsPair) > 0 {
for provider, consumers := range icsPair {
var p ibc.Chain
var c ibc.Chain
var p, c ibc.Chain

// a provider can have multiple consumers
for _, consumer := range consumers {
Expand Down

0 comments on commit f2e746d

Please sign in to comment.