Skip to content

Commit

Permalink
Merge pull request #421 from sge-network/release/v1.7.x
Browse files Browse the repository at this point in the history
Release / v1.7.2
  • Loading branch information
scorpioborn authored Jul 25, 2024
2 parents c293d88 + 59daebc commit 7349c6f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
4 changes: 4 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ var (
v9.Upgrade,
v10.Upgrade,
}
// default wasmd binary maximum allowed size
defaultMaxWasmSize = 1500 * 1024 // 1.5 MB
)

var (
Expand Down Expand Up @@ -172,6 +174,8 @@ func NewSgeApp(
// https://github.com/CosmWasm/wasmd#compile-time-parameters
val, _ := strconv.ParseInt(maxSize, 10, 32)
wasmtypes.MaxWasmSize = int(val)
} else {
wasmtypes.MaxWasmSize = defaultMaxWasmSize
}

// NOTE: we may consider parsing `appOpts` inside module constructors. For the moment
Expand Down
4 changes: 2 additions & 2 deletions app/upgrades/v10/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"github.com/sge-network/sge/app/upgrades"
)

// UpgradeName defines the on-chain upgrade name for the v1.7.1 upgrade.
const UpgradeName = "v1.7.1"
// UpgradeName defines the on-chain upgrade name for the v1.7.2 upgrade.
const UpgradeName = "v1.7.2"

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
Expand Down
33 changes: 18 additions & 15 deletions x/reward/client/cli/query_reward.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,24 +77,26 @@ func CmdGetReward() *cobra.Command {

func CmdGetRewardsByUser() *cobra.Command {
cmd := &cobra.Command{
Use: "rewards-by-address [address]",
Short: "shows a list of rewards by address",
Args: cobra.ExactArgs(1),
Use: "rewards-by-address [promoter_uid] [address]",
Short: "shows a list of rewards by promoter and address",
Args: cobra.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) (err error) {
clientCtx := client.GetClientContextFromCmd(cmd)

queryClient := types.NewQueryClient(clientCtx)

argAddress := args[0]
argPromoterUID := args[0]
argAddress := args[1]

pageReq, err := client.ReadPageRequest(cmd.Flags())
if err != nil {
return err
}

params := &types.QueryRewardsByAddressRequest{
Address: argAddress,
Pagination: pageReq,
PromoterUid: argPromoterUID,
Address: argAddress,
Pagination: pageReq,
}

res, err := queryClient.RewardsByAddress(context.Background(), params)
Expand Down Expand Up @@ -150,17 +152,17 @@ func CmdGetRewardsByCampaign() *cobra.Command {

func CmdGetRewardByUserAndCategory() *cobra.Command {
cmd := &cobra.Command{
Use: "rewards-by-user-category [address] [category]",
Short: "shows a list of rewards by user and category",
Args: cobra.ExactArgs(2),
Use: "rewards-by-user-category [promoter_uid] [address] [category]",
Short: "shows a list of rewards by promoter, user, and category",
Args: cobra.ExactArgs(3),
RunE: func(cmd *cobra.Command, args []string) (err error) {
clientCtx := client.GetClientContextFromCmd(cmd)

queryClient := types.NewQueryClient(clientCtx)

argUser := args[0]
argRewCategory := args[1]
argRewCategoryint32, err := cast.ToInt32E(argRewCategory)
argPromoterUID := args[0]
argUser := args[1]
argRewCategoryInt32, err := cast.ToInt32E(args[2])
if err != nil {
return err
}
Expand All @@ -171,9 +173,10 @@ func CmdGetRewardByUserAndCategory() *cobra.Command {
}

params := &types.QueryRewardsByAddressAndCategoryRequest{
Address: argUser,
Category: types.RewardCategory(argRewCategoryint32),
Pagination: pageReq,
PromoterUid: argPromoterUID,
Address: argUser,
Category: types.RewardCategory(argRewCategoryInt32),
Pagination: pageReq,
}

res, err := queryClient.RewardsByAddressAndCategory(context.Background(), params)
Expand Down

0 comments on commit 7349c6f

Please sign in to comment.