From 40c0cd7b3eac59808664c77d6d46a0c0b65cbdc3 Mon Sep 17 00:00:00 2001 From: scorpioborn <97235353+scorpioborn@users.noreply.github.com> Date: Tue, 25 Jun 2024 12:28:59 +0300 Subject: [PATCH 1/3] fix: cli query promoter inclusion --- x/reward/client/cli/query_reward.go | 33 ++++++++++++++++------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/x/reward/client/cli/query_reward.go b/x/reward/client/cli/query_reward.go index b2a7cc27..8522170c 100644 --- a/x/reward/client/cli/query_reward.go +++ b/x/reward/client/cli/query_reward.go @@ -77,15 +77,16 @@ 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 { @@ -93,8 +94,9 @@ func CmdGetRewardsByUser() *cobra.Command { } params := &types.QueryRewardsByAddressRequest{ - Address: argAddress, - Pagination: pageReq, + PromoterUid: argPromoterUID, + Address: argAddress, + Pagination: pageReq, } res, err := queryClient.RewardsByAddress(context.Background(), params) @@ -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 } @@ -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) From f3dc64c9a64a960745e6848cc194010b3482cd0d Mon Sep 17 00:00:00 2001 From: scorpioborn <97235353+scorpioborn@users.noreply.github.com> Date: Fri, 19 Jul 2024 12:39:39 +0300 Subject: [PATCH 2/3] feat: upgrade handler v1.7.2 version rename --- app/upgrades/v10/consts.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/upgrades/v10/consts.go b/app/upgrades/v10/consts.go index ebd706b2..c427491e 100644 --- a/app/upgrades/v10/consts.go +++ b/app/upgrades/v10/consts.go @@ -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, From 59daebc4674bb3218f54510a3085b9899fefe514 Mon Sep 17 00:00:00 2001 From: scorpioborn <97235353+scorpioborn@users.noreply.github.com> Date: Tue, 23 Jul 2024 17:16:01 +0300 Subject: [PATCH 3/3] fix: set default wasmd allowed binary size to 1.5mb --- app/app.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/app.go b/app/app.go index b80f19c6..8217e740 100644 --- a/app/app.go +++ b/app/app.go @@ -82,6 +82,8 @@ var ( v9.Upgrade, v10.Upgrade, } + // default wasmd binary maximum allowed size + defaultMaxWasmSize = 1500 * 1024 // 1.5 MB ) var ( @@ -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