Skip to content

Commit

Permalink
fix: pluralize GetNShortestLeases (#111)
Browse files Browse the repository at this point in the history
since it returns a list of keyleases

Co-authored-by: Neeraj Murarka <njmurarka@users.noreply.github.com>
  • Loading branch information
kelonye and njmurarka committed Apr 23, 2020
1 parent f963100 commit 3bca9f8
Show file tree
Hide file tree
Showing 16 changed files with 68 additions and 68 deletions.
10 changes: 5 additions & 5 deletions x/crud/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func GetQueryCmd(storeKey string, cdc *codec.Codec) *cobra.Command {
GetCmdQKeyValues(storeKey, cdc),
GetCmdQCount(storeKey, cdc),
GetCmdQGetLease(storeKey, cdc),
GetCmdQGetNShortestLease(storeKey, cdc),
GetCmdQGetNShortestLeases(storeKey, cdc),
)...)

return crudQueryCmd
Expand Down Expand Up @@ -173,10 +173,10 @@ func GetCmdQGetLease(queryRoute string, cdc *codec.Codec) *cobra.Command {
}
}

func GetCmdQGetNShortestLease(queryRoute string, cdc *codec.Codec) *cobra.Command {
func GetCmdQGetNShortestLeases(queryRoute string, cdc *codec.Codec) *cobra.Command {
return &cobra.Command{
Use: "getnshortestlease [UUID] [N]",
Short: "getnshortestlease UUID N",
Use: "getnshortestleases [UUID] [N]",
Short: "getnshortestleases UUID N",
Args: cobra.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
cliCtx := context.NewCLIContext().WithCodec(cdc)
Expand All @@ -188,7 +188,7 @@ func GetCmdQGetNShortestLease(queryRoute string, cdc *codec.Codec) *cobra.Comman
return nil
}

res, _, err := cliCtx.QueryWithData(fmt.Sprintf("custom/%s/getnshortestlease/%s/%d", queryRoute, UUID, N), nil)
res, _, err := cliCtx.QueryWithData(fmt.Sprintf("custom/%s/getnshortestleases/%s/%d", queryRoute, UUID, N), nil)

var out types.QueryResultNShortestLeaseKeys
cdc.MustUnmarshalJSON(res, &out)
Expand Down
8 changes: 4 additions & 4 deletions x/crud/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func GetTxCmd(_ string, cdc *codec.Codec) *cobra.Command {
GetCmdDelete(cdc),
GetCmdDeleteAll(cdc),
GetCmdGetLease(cdc),
GetCmdGetNShortestLease(cdc),
GetCmdGetNShortestLeases(cdc),
GetCmdHas(cdc),
GetCmdKeyValues(cdc),
GetCmdKeys(cdc),
Expand Down Expand Up @@ -329,9 +329,9 @@ func GetCmdGetLease(cdc *codec.Codec) *cobra.Command {
}
}

func GetCmdGetNShortestLease(cdc *codec.Codec) *cobra.Command {
func GetCmdGetNShortestLeases(cdc *codec.Codec) *cobra.Command {
return &cobra.Command{
Use: "getnshortestlease [UUID] [N]",
Use: "getnshortestleases [UUID] [N]",
Short: "get the N shortest remaining lease blocks for an existing UUID",
Args: cobra.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
Expand All @@ -345,7 +345,7 @@ func GetCmdGetNShortestLease(cdc *codec.Codec) *cobra.Command {
return err
}

msg := types.MsgGetNShortestLease{UUID: args[0], N: N, Owner: cliCtx.GetFromAddress()}
msg := types.MsgGetNShortestLeases{UUID: args[0], N: N, Owner: cliCtx.GetFromAddress()}

err = msg.ValidateBasic()
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions x/crud/client/rest/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ func BlzQGetLeaseHandler(cliCtx context.CLIContext, storeName string) http.Handl
}
}

func BlzQGetNShortestLeaseHandler(cliCtx context.CLIContext, storeName string) http.HandlerFunc {
func BlzQGetNShortestLeasesHandler(cliCtx context.CLIContext, storeName string) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)

res, _, err := cliCtx.QueryWithData(fmt.Sprintf("custom/%s/getnshortestlease/%s/%s", storeName, vars["UUID"], vars["N"]), nil)
res, _, err := cliCtx.QueryWithData(fmt.Sprintf("custom/%s/getnshortestleases/%s/%s", storeName, vars["UUID"], vars["N"]), nil)
if err != nil {
rest.WriteErrorResponse(w, http.StatusNotFound, err.Error())
return
Expand Down
4 changes: 2 additions & 2 deletions x/crud/client/rest/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ func RegisterRoutes(cliCtx context.CLIContext, r *mux.Router, storeName string)
r.HandleFunc(fmt.Sprintf("/%s/deleteall", storeName), BlzDeleteAllHandler(cliCtx)).Methods("POST")
r.HandleFunc(fmt.Sprintf("/%s/getlease", storeName), BlzGetLeaseHandler(cliCtx)).Methods("POST")
r.HandleFunc(fmt.Sprintf("/%s/getlease/{UUID}/{key}", storeName), BlzQGetLeaseHandler(cliCtx, storeName)).Methods("GET")
r.HandleFunc(fmt.Sprintf("/%s/getnshortestlease", storeName), BlzGetNShortestLeaseHandler(cliCtx)).Methods("POST")
r.HandleFunc(fmt.Sprintf("/%s/getnshortestlease/{UUID}/{N}", storeName), BlzQGetNShortestLeaseHandler(cliCtx, storeName)).Methods("GET")
r.HandleFunc(fmt.Sprintf("/%s/getnshortestleases", storeName), BlzGetNShortestLeasesHandler(cliCtx)).Methods("POST")
r.HandleFunc(fmt.Sprintf("/%s/getnshortestleases/{UUID}/{N}", storeName), BlzQGetNShortestLeasesHandler(cliCtx, storeName)).Methods("GET")
r.HandleFunc(fmt.Sprintf("/%s/has", storeName), BlzHasHandler(cliCtx)).Methods("POST")
r.HandleFunc(fmt.Sprintf("/%s/has/{UUID}/{key}", storeName), BlzQHasHandler(cliCtx, storeName)).Methods("GET")
r.HandleFunc(fmt.Sprintf("/%s/keys", storeName), BlzKeysHandler(cliCtx)).Methods("POST")
Expand Down
8 changes: 4 additions & 4 deletions x/crud/client/rest/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,16 +500,16 @@ func BlzGetLeaseHandler(cliCtx context.CLIContext) http.HandlerFunc {

///////////////////////////////////////////////////////////////////////////////
// Get N Shortest Lease
type GetNShortestLeaseReq struct {
type GetNShortestLeasesReq struct {
BaseReq rest.BaseReq
UUID string
N uint64
Owner string
}

func BlzGetNShortestLeaseHandler(cliCtx context.CLIContext) http.HandlerFunc {
func BlzGetNShortestLeasesHandler(cliCtx context.CLIContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req GetNShortestLeaseReq
var req GetNShortestLeasesReq

if !rest.ReadRESTReq(w, r, cliCtx.Codec, &req) {
rest.WriteErrorResponse(w, http.StatusBadRequest, "failed to parse request")
Expand All @@ -528,7 +528,7 @@ func BlzGetNShortestLeaseHandler(cliCtx context.CLIContext) http.HandlerFunc {
}

// create the message
msg := types.MsgGetNShortestLease{UUID: req.UUID, N: req.N, Owner: addr}
msg := types.MsgGetNShortestLeases{UUID: req.UUID, N: req.N, Owner: addr}
err = msg.ValidateBasic()
if err != nil {
rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error())
Expand Down
8 changes: 4 additions & 4 deletions x/crud/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ func NewHandler(keeper keeper.IKeeper) sdk.Handler {
return handleMsgMultiUpdate(ctx, keeper, msg)
case types.MsgGetLease:
return handleMsgGetLease(ctx, keeper, msg)
case types.MsgGetNShortestLease:
return handleMsgGetNShortestLease(ctx, keeper, msg)
case types.MsgGetNShortestLeases:
return handleMsgGetNShortestLeases(ctx, keeper, msg)
case types.MsgRenewLease:
return handleMsgRenewLease(ctx, keeper, msg)
case types.MsgRenewLeaseAll:
Expand Down Expand Up @@ -298,12 +298,12 @@ func handleMsgGetLease(ctx sdk.Context, keeper keeper.IKeeper, msg types.MsgGetL
return &sdk.Result{Data: jsonData}, nil
}

func handleMsgGetNShortestLease(ctx sdk.Context, keeper keeper.IKeeper, msg types.MsgGetNShortestLease) (*sdk.Result, error) {
func handleMsgGetNShortestLeases(ctx sdk.Context, keeper keeper.IKeeper, msg types.MsgGetNShortestLeases) (*sdk.Result, error) {
if len(msg.UUID) == 0 || msg.N == 0 || msg.Owner.Empty() {
return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Invalid message")
}

value := keeper.GetNShortestLease(ctx, keeper.GetKVStore(ctx), msg.UUID, msg.Owner, msg.N)
value := keeper.GetNShortestLeases(ctx, keeper.GetKVStore(ctx), msg.UUID, msg.Owner, msg.N)

jsonData, err := json.Marshal(value)

Expand Down
12 changes: 6 additions & 6 deletions x/crud/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ func Test_handleMsgGetLease(t *testing.T) {

}

func Test_handleMsgGetNShortestLease(t *testing.T) {
func Test_handleMsgGetNShortestLeases(t *testing.T) {
mockCtrl, mockKeeper, ctx, owner := initTest(t)
defer mockCtrl.Finish()

Expand All @@ -793,9 +793,9 @@ func Test_handleMsgGetNShortestLease(t *testing.T) {
}

mockKeeper.EXPECT().GetKVStore(gomock.Any()).AnyTimes().Return(nil)
mockKeeper.EXPECT().GetNShortestLease(ctx, nil, "uuid", gomock.Any(), uint64(5)).Return(response)
mockKeeper.EXPECT().GetNShortestLeases(ctx, nil, "uuid", gomock.Any(), uint64(5)).Return(response)

result, err := NewHandler(mockKeeper)(ctx, types.MsgGetNShortestLease{UUID: "uuid", Owner: owner, N: 5})
result, err := NewHandler(mockKeeper)(ctx, types.MsgGetNShortestLeases{UUID: "uuid", Owner: owner, N: 5})

assert.Nil(t, err)
jsonResult := types.QueryResultNShortestLeaseKeys{}
Expand All @@ -805,13 +805,13 @@ func Test_handleMsgGetNShortestLease(t *testing.T) {

// Test for empty message parameters
{
_, err := handleMsgGetNShortestLease(ctx, mockKeeper, types.MsgGetNShortestLease{})
_, err := handleMsgGetNShortestLeases(ctx, mockKeeper, types.MsgGetNShortestLeases{})
assert.NotNil(t, err)

_, err = handleMsgGetNShortestLease(ctx, mockKeeper, types.MsgGetNShortestLease{UUID: "uuid"})
_, err = handleMsgGetNShortestLeases(ctx, mockKeeper, types.MsgGetNShortestLeases{UUID: "uuid"})
assert.NotNil(t, err)

_, err = handleMsgGetNShortestLease(ctx, mockKeeper, types.MsgGetNShortestLease{UUID: "uuid", N: 11})
_, err = handleMsgGetNShortestLeases(ctx, mockKeeper, types.MsgGetNShortestLeases{UUID: "uuid", N: 11})
assert.NotNil(t, err)
}
}
Expand Down
4 changes: 2 additions & 2 deletions x/crud/internal/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type IKeeper interface {
GetKeyValues(ctx sdk.Context, store sdk.KVStore, UUID string, owner sdk.AccAddress) types.QueryResultKeyValues
GetKeys(ctx sdk.Context, store sdk.KVStore, UUID string, owner sdk.AccAddress) types.QueryResultKeys
GetLeaseStore(ctx sdk.Context) sdk.KVStore
GetNShortestLease(ctx sdk.Context, store sdk.KVStore, UUID string, owner sdk.AccAddress, n uint64) types.QueryResultNShortestLeaseKeys
GetNShortestLeases(ctx sdk.Context, store sdk.KVStore, UUID string, owner sdk.AccAddress, n uint64) types.QueryResultNShortestLeaseKeys
GetOwner(ctx sdk.Context, store sdk.KVStore, UUID string, key string) sdk.AccAddress
GetValue(ctx sdk.Context, store sdk.KVStore, UUID string, key string) types.BLZValue
GetValuesIterator(ctx sdk.Context, store sdk.KVStore) sdk.Iterator
Expand Down Expand Up @@ -284,7 +284,7 @@ func (k Keeper) ProcessLeasesAtBlockHeight(_ sdk.Context, store sdk.KVStore, lea
}
}

func (k Keeper) GetNShortestLease(ctx sdk.Context, store sdk.KVStore, UUID string, owner sdk.AccAddress, n uint64) types.QueryResultNShortestLeaseKeys {
func (k Keeper) GetNShortestLeases(ctx sdk.Context, store sdk.KVStore, UUID string, owner sdk.AccAddress, n uint64) types.QueryResultNShortestLeaseKeys {
keys := k.GetKeys(ctx, store, UUID, owner)

if len(keys.Keys) == 0 {
Expand Down
8 changes: 4 additions & 4 deletions x/crud/internal/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ func TestKeeper_GetCdc(t *testing.T) {
assert.Equal(t, cdc, keeper.GetCdc())
}

func TestKeeper_GetNShortestLease(t *testing.T) {
func TestKeeper_GetNShortestLeases(t *testing.T) {
ctx, testStore, owner, cdc := initKeeperTest()
keeper := NewKeeper(nil, nil, nil, cdc, MaxKeeperSizes{MaxKeysSize: 1024})

Expand All @@ -509,19 +509,19 @@ func TestKeeper_GetNShortestLease(t *testing.T) {

// there are at least 10 keys
newCtx := ctx.WithBlockHeight(currentBlockHeight)
response := keeper.GetNShortestLease(newCtx, testStore, "uuid", owner, 5)
response := keeper.GetNShortestLeases(newCtx, testStore, "uuid", owner, 5)

assert.Equal(t, "uuid", response.UUID)
assert.Equal(t, 5, len(response.KeyLeases))

assert.Equal(t, "key9910", response.KeyLeases[0].Key)
assert.Equal(t, 9910+1000-currentBlockHeight, response.KeyLeases[0].Lease)

response = keeper.GetNShortestLease(newCtx, testStore, "wronguuid", owner, 5)
response = keeper.GetNShortestLeases(newCtx, testStore, "wronguuid", owner, 5)
assert.Equal(t, "wronguuid", response.UUID)
assert.Equal(t, 0, len(response.KeyLeases))

response = keeper.GetNShortestLease(newCtx, testStore, "uuid", owner, 11)
response = keeper.GetNShortestLeases(newCtx, testStore, "uuid", owner, 11)
assert.Equal(t, "uuid", response.UUID)
assert.Equal(t, 10, len(response.KeyLeases))

Expand Down
10 changes: 5 additions & 5 deletions x/crud/internal/keeper/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
QueryKeyValues = "keyvalues"
QueryCount = "count"
QueryGetLease = "getlease"
QueryGetNShortestLease = "getnshortestlease"
QueryGetNShortestLeases = "getnshortestleases"
)

func NewQuerier(keeper IKeeper) sdk.Querier {
Expand All @@ -48,8 +48,8 @@ func NewQuerier(keeper IKeeper) sdk.Querier {
return queryCount(ctx, path[1:], req, keeper, keeper.GetCdc())
case QueryGetLease:
return queryGetLease(ctx, path[1:], req, keeper, keeper.GetCdc())
case QueryGetNShortestLease:
return queryGetNShortestLease(ctx, path[1:], req, keeper, keeper.GetCdc())
case QueryGetNShortestLeases:
return queryGetNShortestLeases(ctx, path[1:], req, keeper, keeper.GetCdc())
default:
return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "unknown crud query endpoint")
}
Expand Down Expand Up @@ -124,14 +124,14 @@ func queryGetLease(ctx sdk.Context, path []string, _ abci.RequestQuery, keeper I
return res, nil
}

func queryGetNShortestLease(ctx sdk.Context, path []string, _ abci.RequestQuery, keeper IKeeper, cdc *codec.Codec) ([]byte, error) {
func queryGetNShortestLeases(ctx sdk.Context, path []string, _ abci.RequestQuery, keeper IKeeper, cdc *codec.Codec) ([]byte, error) {

N, err := strconv.ParseUint(path[1], 10, 64)
if err != nil {
return []byte{}, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, err.Error())
}

value := keeper.GetNShortestLease(ctx, keeper.GetKVStore(ctx), path[0], nil, N)
value := keeper.GetNShortestLeases(ctx, keeper.GetKVStore(ctx), path[0], nil, N)

res, err := codec.MarshalJSONIndent(cdc, value)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions x/crud/internal/keeper/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ func Test_queryGetLease(t *testing.T) {
assert.NotNil(t, err)
}

func Test_queryGetNShortestLease(t *testing.T) {
func Test_queryGetNShortestLeases(t *testing.T) {
ctx, cdc, mockKeeper := initTest(t)

mockKeeper.EXPECT().GetKVStore(gomock.Any()).AnyTimes().Return(nil)
mockKeeper.EXPECT().GetNShortestLease(ctx, nil, "uuid", nil, uint64(10)).Return(types.QueryResultNShortestLeaseKeys{
mockKeeper.EXPECT().GetNShortestLeases(ctx, nil, "uuid", nil, uint64(10)).Return(types.QueryResultNShortestLeaseKeys{
UUID: "uuid",
KeyLeases: types.KeyLeases{
types.KeyLease{
Expand All @@ -207,7 +207,7 @@ func Test_queryGetNShortestLease(t *testing.T) {

mockKeeper.EXPECT().GetCdc().AnyTimes().Return(cdc)

result, err := NewQuerier(mockKeeper)(ctx, []string{"getnshortestlease", "uuid", "10"}, abci.RequestQuery{})
result, err := NewQuerier(mockKeeper)(ctx, []string{"getnshortestleases", "uuid", "10"}, abci.RequestQuery{})
assert.Nil(t, err)

jsonResult := types.QueryResultNShortestLeaseKeys{}
Expand All @@ -217,7 +217,7 @@ func Test_queryGetNShortestLease(t *testing.T) {
assert.Equal(t, "key00", jsonResult.KeyLeases[0].Key)
assert.Equal(t, int64(100), jsonResult.KeyLeases[0].Lease)

_, err = NewQuerier(mockKeeper)(ctx, []string{"getnshortestlease", "uuid", "abcd"}, abci.RequestQuery{})
_, err = NewQuerier(mockKeeper)(ctx, []string{"getnshortestleases", "uuid", "abcd"}, abci.RequestQuery{})

assert.NotNil(t, err)
}
2 changes: 1 addition & 1 deletion x/crud/internal/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func RegisterCodec(cdc *codec.Codec) {
cdc.RegisterConcrete(MsgDeleteAll{}, "crud/deleteall", nil)
cdc.RegisterConcrete(MsgDelete{}, "crud/delete", nil)
cdc.RegisterConcrete(MsgGetLease{}, "crud/getlease", nil)
cdc.RegisterConcrete(MsgGetNShortestLease{}, "crud/getnshortestlease", nil)
cdc.RegisterConcrete(MsgGetNShortestLeases{}, "crud/getnshortestleases", nil)
cdc.RegisterConcrete(MsgHas{}, "crud/has", nil)
cdc.RegisterConcrete(MsgKeyValues{}, "crud/keyvalues", nil)
cdc.RegisterConcrete(MsgKeys{}, "crud/keys", nil)
Expand Down
12 changes: 6 additions & 6 deletions x/crud/internal/types/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,17 +503,17 @@ func (msg MsgGetLease) GetSigners() []sdk.AccAddress {

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// GetLease
type MsgGetNShortestLease struct {
type MsgGetNShortestLeases struct {
UUID string
N uint64
Owner sdk.AccAddress
}

func (msg MsgGetNShortestLease) Route() string { return RouterKey }
func (msg MsgGetNShortestLeases) Route() string { return RouterKey }

func (msg MsgGetNShortestLease) Type() string { return "getnshortestlease" }
func (msg MsgGetNShortestLeases) Type() string { return "getnshortestleases" }

func (msg MsgGetNShortestLease) ValidateBasic() error {
func (msg MsgGetNShortestLeases) ValidateBasic() error {
if msg.Owner.Empty() {
return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, msg.Owner.String())
}
Expand All @@ -529,11 +529,11 @@ func (msg MsgGetNShortestLease) ValidateBasic() error {
return nil
}

func (msg MsgGetNShortestLease) GetSignBytes() []byte {
func (msg MsgGetNShortestLeases) GetSignBytes() []byte {
return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg))
}

func (msg MsgGetNShortestLease) GetSigners() []sdk.AccAddress {
func (msg MsgGetNShortestLeases) GetSigners() []sdk.AccAddress {
return []sdk.AccAddress{msg.Owner}
}

Expand Down
22 changes: 11 additions & 11 deletions x/crud/internal/types/msgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -614,16 +614,16 @@ func TestMsgGetLease_GetSigners(t *testing.T) {
}

/////////////////////////////////////////////////////////////////////////////////
func TestMsgGetNShortestLease_Route(t *testing.T) {
Equal(t, "crud", MsgGetNShortestLease{}.Route())
func TestMsgGetNShortestLeases_Route(t *testing.T) {
Equal(t, "crud", MsgGetNShortestLeases{}.Route())
}

func TestMsgGetNShortestLease_Type(t *testing.T) {
Equal(t, "getnshortestlease", MsgGetNShortestLease{}.Type())
func TestMsgGetNShortestLeases_Type(t *testing.T) {
Equal(t, "getnshortestleases", MsgGetNShortestLeases{}.Type())
}

func TestMsgGetNShortestLease_ValidateBasic(t *testing.T) {
sut := MsgGetNShortestLease{
func TestMsgGetNShortestLeases_ValidateBasic(t *testing.T) {
sut := MsgGetNShortestLeases{
UUID: "uuid",
N: 10,
Owner: []byte("bluzelle1t0ywtmrduldf6h4wqrnnpyp9wr6law2u5jwa23"),
Expand All @@ -644,17 +644,17 @@ func TestMsgGetNShortestLease_ValidateBasic(t *testing.T) {

}

func TestMsgGetNShortestLease_GetSignBytes(t *testing.T) {
sut := MsgGetNShortestLease{
func TestMsgGetNShortestLeases_GetSignBytes(t *testing.T) {
sut := MsgGetNShortestLeases{
UUID: "uuid",
N: 10,
Owner: []byte("bluzelle1t0ywtmrduldf6h4wqrnnpyp9wr6law2u5jwa23"),
}
Equal(t, "{\"type\":\"crud/getnshortestlease\",\"value\":{\"N\":\"10\",\"Owner\":\"cosmos1vfk827n9d3kx2vt5xpuhwardwfj82mryvcmxsdrhw9exumns09crjamjxekxzaejw56k5ampxgeslhg4h3\",\"UUID\":\"uuid\"}}", string(sut.GetSignBytes()))
Equal(t, "{\"type\":\"crud/getnshortestleases\",\"value\":{\"N\":\"10\",\"Owner\":\"cosmos1vfk827n9d3kx2vt5xpuhwardwfj82mryvcmxsdrhw9exumns09crjamjxekxzaejw56k5ampxgeslhg4h3\",\"UUID\":\"uuid\"}}", string(sut.GetSignBytes()))
}

func TestMsgGetNShortestLease_GetSigners(t *testing.T) {
sut := MsgGetNShortestLease{
func TestMsgGetNShortestLeases_GetSigners(t *testing.T) {
sut := MsgGetNShortestLeases{
UUID: "uuid",
N: 10,
Owner: []byte("bluzelle1t0ywtmrduldf6h4wqrnnpyp9wr6law2u5jwa23"),
Expand Down

0 comments on commit 3bca9f8

Please sign in to comment.