Skip to content

Commit

Permalink
e2e: fix consumer; partially fix Dockerfile [hermes broken]
Browse files Browse the repository at this point in the history
  • Loading branch information
MSalopek committed Nov 3, 2023
1 parent a2ae629 commit 0684ff4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RUN go mod tidy
RUN make install

# Get Hermes build
FROM ghcr.io/informalsystems/hermes:1.4.1 AS hermes-builder
FROM ghcr.io/informalsystems/hermes:v1.7.0 AS hermes-builder

# Get CometMock
FROM ghcr.io/informalsystems/cometmock:v0.37.x as cometmock-builder
Expand Down
1 change: 1 addition & 0 deletions app/consumer/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ func New(
paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey,
evidencetypes.StoreKey, ibctransfertypes.StoreKey,
capabilitytypes.StoreKey, feegrant.StoreKey, authzkeeper.StoreKey,
consensusparamtypes.StoreKey,
ibcconsumertypes.StoreKey,
)
tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey)
Expand Down
13 changes: 9 additions & 4 deletions tests/e2e/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,11 @@ func (tr TestRun) getProposal(chain chainID, proposal uint) Proposal {
}

type TmValidatorSetYaml struct {
Total string `yaml:"total"`
BlockHeight string `yaml:"block_height"`
Pagination struct {
NextKey string `yaml:"next_key"`
Total string `yaml:"total"`
} `yaml:"pagination"`
Validators []struct {
Address string `yaml:"address"`
VotingPower string `yaml:"voting_power"`
Expand Down Expand Up @@ -502,14 +506,15 @@ func (tr TestRun) getValPower(chain chainID, validator validatorID) uint {
log.Fatalf("yaml.Unmarshal returned an error while unmarshalling validator set: %v, input: %s", err, string(bz))
}

total, err := strconv.Atoi(valset.Total)
total, err := strconv.Atoi(valset.Pagination.Total)
if err != nil {
log.Fatalf("strconv.Atoi returned an error while coonverting total for validator set: %v, input: %s, validator set: %s", err, valset.Total, pretty.Sprint(valset))
log.Fatalf("strconv.Atoi returned an error while coonverting total for validator set: %v, input: %s, validator set: %s", err, valset.Pagination.Total, pretty.Sprint(valset))
}

// this only works on small valsets -> otherwise pagination must be used
if total != len(valset.Validators) {
log.Fatalf("Total number of validators %v does not match number of validators in list %v. Probably a query pagination issue. Validator set: %v",
valset.Total, uint(len(valset.Validators)), pretty.Sprint(valset))
valset.Pagination.Total, uint(len(valset.Validators)), pretty.Sprint(valset))
}

for _, val := range valset.Validators {
Expand Down

0 comments on commit 0684ff4

Please sign in to comment.