From cb148f0d13b9f0cf7380eb99e39ae3efdfe77a13 Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Sun, 9 Feb 2020 21:59:20 +0100 Subject: [PATCH] Sort the contract addresses on queries --- x/wasm/internal/keeper/querier.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x/wasm/internal/keeper/querier.go b/x/wasm/internal/keeper/querier.go index f8a946b..edba4b5 100644 --- a/x/wasm/internal/keeper/querier.go +++ b/x/wasm/internal/keeper/querier.go @@ -2,6 +2,7 @@ package keeper import ( "encoding/json" + "sort" "strconv" sdk "github.com/cosmos/cosmos-sdk/types" @@ -72,6 +73,7 @@ func queryContractList(ctx sdk.Context, req abci.RequestQuery, keeper Keeper) ([ addrs = append(addrs, addr.String()) return false }) + sort.Strings(addrs) bz, err := json.MarshalIndent(addrs, "", " ") if err != nil { return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())