Skip to content

Commit

Permalink
chore: apply changes from review
Browse files Browse the repository at this point in the history
  • Loading branch information
technicallyty committed Nov 12, 2021
1 parent 5e869e4 commit ae8dc9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions modules/core/02-client/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,11 @@ func (k Keeper) GetSelfConsensusState(ctx sdk.Context, height exported.Height) (
// check that height revision matches chainID revision
revision := types.ParseChainID(ctx.ChainID())
if revision != height.GetRevisionNumber() {
return nil, sdkerrors.ErrInvalidHeight.Wrapf("height revision %d does not match chainID revision %d", revision, height.GetRevisionNumber())
return nil, sdkerrors.Wrapf(types.ErrInvalidHeight, "chainID revision number does not match height revision number: expected %d, got %d", revision, height.GetRevisionNumber())
}
histInfo, found := k.stakingKeeper.GetHistoricalInfo(ctx, int64(selfHeight.RevisionHeight))
if !found {
return nil, sdkerrors.ErrNotFound.Wrapf("no historical info found at height %d", selfHeight.RevisionHeight)
return nil, sdkerrors.Wrapf(sdkerrors.ErrNotFound, "no historical info found at height %d", selfHeight.RevisionHeight)
}

consensusState := &ibctmtypes.ConsensusState{
Expand Down
6 changes: 3 additions & 3 deletions modules/core/03-connection/keeper/handshake.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ func (k Keeper) ConnOpenTry(
}

expectedConsensusState, err := k.clientKeeper.GetSelfConsensusState(ctx, consensusHeight)
if err != nil{
return "", clienttypes.ErrSelfConsensusStateNotFound.Wrapf(err.Error(), consensusHeight.String())
if err != nil {
return "", sdkerrors.Wrapf(err, "self consensus state not found for height %s", consensusHeight.String())
}

// expectedConnection defines Chain A's ConnectionEnd
Expand Down Expand Up @@ -252,7 +252,7 @@ func (k Keeper) ConnOpenAck(
// Retrieve chainA's consensus state at consensusheight
expectedConsensusState, err := k.clientKeeper.GetSelfConsensusState(ctx, consensusHeight)
if err != nil {
return clienttypes.ErrSelfConsensusStateNotFound.Wrap(err.Error())
return sdkerrors.Wrapf(err, "self consensus state not found for height %s", consensusHeight.String())
}

prefix := k.GetCommitmentPrefix()
Expand Down

0 comments on commit ae8dc9e

Please sign in to comment.