-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #368 from sge-network/feature/bet-bonus
Feature / Bet Bonus Reward
- Loading branch information
Showing
40 changed files
with
3,420 additions
and
362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
syntax = "proto3"; | ||
package sgenetwork.sge.reward; | ||
|
||
import "gogoproto/gogo.proto"; | ||
|
||
import "sge/reward/reward.proto"; | ||
|
||
option go_package = "github.com/sge-network/sge/x/reward/types"; | ||
|
||
// Promoter is type for defining the reward promoter properties and configuration. | ||
message Promoter { | ||
// creator is the address of promoter. | ||
string creator = 1; | ||
|
||
// uid is the unique identifier of a promoter. | ||
string uid = 2 [ | ||
(gogoproto.customname) = "UID", | ||
(gogoproto.jsontag) = "uid", | ||
json_name = "uid" | ||
]; | ||
|
||
// addresses is the list of account addresses of promoter. | ||
repeated string addresses = 3; | ||
|
||
// conf is the configurations of the current promoter for the reward grant. | ||
PromoterConf conf = 4 [ (gogoproto.nullable) = false ]; | ||
} | ||
|
||
// PromoterConf is type for defining the promoter specific configurations. | ||
message PromoterConf { | ||
// category_cap is the maximium allowed cap for each category. | ||
repeated CategoryCap category_cap = 1 [ (gogoproto.nullable) = false ]; | ||
} | ||
|
||
// CategoryCap is type to define category and its maximum cap. | ||
message CategoryCap { | ||
RewardCategory category = 1; | ||
int32 cap_per_acc = 2; | ||
} | ||
|
||
// PromoterByAddress is type for defining the promoter by address. | ||
message PromoterByAddress { | ||
// promoter_uid is the unique identifier of a certain promoter. | ||
string promoter_uid = 1 [ | ||
(gogoproto.customname) = "PromoterUID", | ||
(gogoproto.jsontag) = "promoter_uid", | ||
json_name = "promoter_uid" | ||
]; | ||
// address is the address of the promoter account. | ||
string address = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package cli | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
|
||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/cosmos/cosmos-sdk/client/flags" | ||
"github.com/cosmos/cosmos-sdk/client/tx" | ||
|
||
"github.com/sge-network/sge/x/reward/types" | ||
) | ||
|
||
func CmdSetPromoterConf() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "set-promoter-conf [uid] [ticket]", | ||
Short: "Set promoter config", | ||
Long: "Set promoter config of a promoter by uid and the ticket", | ||
Args: cobra.ExactArgs(2), | ||
RunE: func(cmd *cobra.Command, args []string) (err error) { | ||
// Get indexes | ||
argUID := args[0] | ||
|
||
// Get value arguments | ||
argTicket := args[1] | ||
|
||
clientCtx, err := client.GetClientTxContext(cmd) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
msg := types.NewMsgSetPromoterConfig( | ||
clientCtx.GetFromAddress().String(), | ||
argUID, | ||
argTicket, | ||
) | ||
if err := msg.ValidateBasic(); err != nil { | ||
return err | ||
} | ||
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) | ||
}, | ||
} | ||
|
||
flags.AddTxFlagsToCmd(cmd) | ||
|
||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.