Skip to content

Commit

Permalink
address last nit ... hopefully
Browse files Browse the repository at this point in the history
Signed-off-by: Shrenuj Bansal <[email protected]>
  • Loading branch information
shrenujb committed Jun 18, 2024
1 parent 5ae58c9 commit 95e1288
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion protocol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ require (
github.com/spf13/viper v1.18.2
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d
go.uber.org/zap v1.27.0
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2
google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8
google.golang.org/protobuf v1.33.0
gotest.tools/v3 v3.5.1
Expand Down
4 changes: 2 additions & 2 deletions protocol/x/listing/keeper/grpc_query_markets_hard_cap.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ func (k Keeper) MarketsHardCap(
ctx context.Context,
req *types.QueryMarketsHardCap,
) (*types.QueryMarketsHardCapResponse, error) {
hardCap, err := k.GetMarketsHardCap(sdk.UnwrapSDKContext(ctx))
hardCap := k.GetMarketsHardCap(sdk.UnwrapSDKContext(ctx))
return &types.QueryMarketsHardCapResponse{
HardCap: hardCap,
}, err
}, nil
}
4 changes: 2 additions & 2 deletions protocol/x/listing/keeper/listing.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ func (k Keeper) SetMarketsHardCap(ctx sdk.Context, hardCap uint32) error {
}

// Function to get hard cap on listed markets from module store
func (k Keeper) GetMarketsHardCap(ctx sdk.Context) (hardCap uint32, err error) {
func (k Keeper) GetMarketsHardCap(ctx sdk.Context) (hardCap uint32) {
store := ctx.KVStore(k.storeKey)
b := store.Get([]byte(types.HardCapForMarketsKey))
var result gogotypes.UInt32Value
k.cdc.MustUnmarshal(b, &result)
return result.Value, nil
return result.Value
}
3 changes: 1 addition & 2 deletions protocol/x/listing/keeper/msg_server_set_hard_cap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ func TestMsgSetMarketsHardCap(t *testing.T) {
require.Error(t, err)
require.Contains(t, err.Error(), tc.expectedErr)
} else {
enabledFlag, err := k.GetMarketsHardCap(ctx)
require.NoError(t, err)
enabledFlag := k.GetMarketsHardCap(ctx)
require.Equal(t, tc.msg.HardCapForMarkets, enabledFlag)
}
})
Expand Down

0 comments on commit 95e1288

Please sign in to comment.