Skip to content

Commit

Permalink
proto: rename field
Browse files Browse the repository at this point in the history
  • Loading branch information
taramakage committed Jul 24, 2023
1 parent 81ad442 commit 760cbde
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion modules/side-chain/keeper/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState) {
}

for _, spaceLatestHeight := range data.SpaceLatestHeights {
k.setSpaceLatestHeight(ctx, spaceLatestHeight.Id, spaceLatestHeight.Height)
k.setSpaceLatestHeight(ctx, spaceLatestHeight.SpaceId, spaceLatestHeight.Height)
}
}

Expand Down
4 changes: 2 additions & 2 deletions modules/side-chain/keeper/space.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ func (k Keeper) GetSpaceLatestHeights(ctx sdk.Context) []types.SpaceLatestHeight
}
latestHeight := sdk.BigEndianToUint64(iterator.Value())
latestHeights = append(latestHeights, types.SpaceLatestHeight{
Id: spaceId,
Height: latestHeight,
SpaceId: spaceId,
Height: latestHeight,
})
}
return latestHeights
Expand Down
6 changes: 3 additions & 3 deletions modules/side-chain/types/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ func ValidateGenesis(data GenesisState) error {

// validate SpaceLatestHeight
for _, latestHeight := range data.SpaceLatestHeights {
if !seenSpaceIds[latestHeight.Id] {
return sdkerrors.Wrapf(ErrInvalidSpaceId, "unknown space (%d) during validation", latestHeight.Id)
if !seenSpaceIds[latestHeight.SpaceId] {
return sdkerrors.Wrapf(ErrInvalidSpaceId, "unknown space (%d) during validation", latestHeight.SpaceId)
}

seenBlockHeader := fmt.Sprintf("%d-%d", latestHeight.Id, latestHeight.Height)
seenBlockHeader := fmt.Sprintf("%d-%d", latestHeight.SpaceId, latestHeight.Height)
if !seenBlockHeaderMap[seenBlockHeader] {
return sdkerrors.Wrapf(ErrBlockHeader, "unknown block header (%s) during validation", seenBlockHeader)
}
Expand Down
64 changes: 32 additions & 32 deletions modules/side-chain/types/side-chain.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/side-chain/v1/side-chain.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ message Space {

// SpaceLatestHeight defines the latest height of the side-chain.
message SpaceLatestHeight {
uint64 id = 1;
uint64 space_id = 1;
uint64 height = 2;
}

Expand Down

0 comments on commit 760cbde

Please sign in to comment.