Skip to content

Commit

Permalink
fixing rns expired results in query (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMarstonConnell authored Dec 12, 2024
2 parents 822bec0 + 2416270 commit 8bed924
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/upgrade-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export GOMODCACHE=${ROOT}/../_build/gocache

mkdir -p ../_build/old
git checkout $OLD_VERSION
make build
go build -mod=readonly -o build/canined ./cmd/canined
mv build/canined ./../_build/old/canined
git checkout $NEW_VERSION
make install
Expand Down
6 changes: 4 additions & 2 deletions x/rns/keeper/grpc_query_list_owned_names.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ func (k Keeper) ListOwnedNames(goCtx context.Context, req *types.QueryListOwnedN
}

if names.Value == req.Address {
namess = append(namess, names)
i++
if names.Expires > ctx.BlockHeight() {
namess = append(namess, names)
i++
}
}

}
Expand Down
5 changes: 5 additions & 0 deletions x/rns/keeper/register_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ func (suite *KeeperTestSuite) TestMsgRegisterName() {
suite.Require().NoError(err)
}

rrr, err := suite.queryClient.AllNames(suite.ctx.Context(), &types.QueryAllNames{})
suite.Require().NoError(err)

suite.Require().Equal(100, len(rrr.Name))

r := types.QueryListOwnedNames{
Address: address.String(),
}
Expand Down

0 comments on commit 8bed924

Please sign in to comment.