Skip to content

Commit

Permalink
fix ictest-validator
Browse files Browse the repository at this point in the history
  • Loading branch information
phamminh0811 committed May 14, 2024
1 parent 38f4910 commit 6ce7b9e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/interchaintest/helpers/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ func UnmarshalValidators(config testutil.TestEncodingConfig, data []byte) (staki
}
delete(validator, "unbonding_height")

unbondingOnHoldRefCount, ok := validator["unbonding_on_hold_ref_count"].(string)
if !ok {
return nil, nil, fmt.Errorf("invalid UnbondingOnHoldRefCount")
}
delete(validator, "unbonding_on_hold_ref_count")

delete(validator, "unbonding_ids")

concensusPubkey, ok := validator["consensus_pubkey"].(map[string]interface{})
if !ok {
return nil, nil, fmt.Errorf("invalid consensus_pubkey")
Expand Down Expand Up @@ -80,6 +88,13 @@ func UnmarshalValidators(config testutil.TestEncodingConfig, data []byte) (staki
}
val.UnbondingHeight = unbondingHeightInt

// Convert UnbondingOnHoldRefCount to int64
unbondingOnHoldRefCountInt, err := strconv.ParseInt(unbondingOnHoldRefCount, 10, 64)
if err != nil {
return nil, nil, err
}
val.UnbondingOnHoldRefCount = unbondingOnHoldRefCountInt

// Convert consensus_pubkey to PubKey
concensusPubkeyBz, err := json.Marshal(concensusPubkey)
if err != nil {
Expand Down

0 comments on commit 6ce7b9e

Please sign in to comment.