-
Notifications
You must be signed in to change notification settings - Fork 35
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 #219 from DecentralCardGame/214-early-access
214 early access
- Loading branch information
Showing
31 changed files
with
2,544 additions
and
333 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Test CD | ||
|
||
on: | ||
push: | ||
branches: | ||
- development | ||
|
||
jobs: | ||
run_pull: | ||
name: run pull | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: install liefer | ||
run: | | ||
go install github.com/lxgr-linux/liefer@latest | ||
- name: deploy | ||
run: | | ||
~/go/bin/liefer deliver devnet development ${{ secrets.LIEFER_PRIVKEY }} --address ${{ secrets.LXGR_HOST }}:8080 |
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,11 @@ | ||
syntax = "proto3"; | ||
package decentralcardgame.cardchain.cardchain; | ||
|
||
option go_package = "github.com/DecentralCardGame/Cardchain/x/cardchain/types"; | ||
|
||
message EarlyAccessProposal { | ||
string title = 1; | ||
string description = 2; | ||
string link = 3; | ||
repeated string users = 4; | ||
} |
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,64 @@ | ||
package cli | ||
|
||
import ( | ||
"strconv" | ||
"strings" | ||
|
||
"github.com/DecentralCardGame/Cardchain/x/cardchain/types" | ||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/cosmos/cosmos-sdk/client/tx" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var _ = strconv.Itoa(0) | ||
|
||
func CmdSubmitEarlyAccessProposal() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "early-access-proposal [deposit] [description] [link] [users...]", | ||
Short: "Propose EarlyAccessProposal", | ||
Args: cobra.MinimumNArgs(4), | ||
RunE: func(cmd *cobra.Command, args []string) (err error) { | ||
argDeposit := args[0] | ||
argDescription := args[1] | ||
argLink := args[2] | ||
|
||
clientCtx, err := client.GetClientTxContext(cmd) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
users := args[3:] | ||
|
||
for _, addr := range users { | ||
_, err = sdk.AccAddressFromBech32(addr) | ||
if err != nil { | ||
return err | ||
} | ||
} | ||
|
||
from := clientCtx.GetFromAddress() | ||
proposal := types.EarlyAccessProposal{ | ||
Title: "Early access proposal for: " + strings.Join(users, ", "), | ||
Description: argDescription, | ||
Link: argLink, | ||
Users: users, | ||
} | ||
|
||
deposit, err := sdk.ParseCoinsNormalized(argDeposit) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
msg, err := govtypes.NewMsgSubmitProposal(&proposal, deposit, from) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) | ||
}, | ||
} | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package cli | ||
|
||
import ( | ||
"strconv" | ||
|
||
"github.com/DecentralCardGame/Cardchain/x/cardchain/types" | ||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/cosmos/cosmos-sdk/client/flags" | ||
"github.com/cosmos/cosmos-sdk/client/tx" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var _ = strconv.Itoa(0) | ||
|
||
func CmdDisinviteEarlyAccess() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "disinvite-early-access [user]", | ||
Short: "Broadcast message disinviteEarlyAccess", | ||
Args: cobra.ExactArgs(1), | ||
RunE: func(cmd *cobra.Command, args []string) (err error) { | ||
argUser := args[0] | ||
|
||
clientCtx, err := client.GetClientTxContext(cmd) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
msg := types.NewMsgDisinviteEarlyAccess( | ||
clientCtx.GetFromAddress().String(), | ||
argUser, | ||
) | ||
if err := msg.ValidateBasic(); err != nil { | ||
return err | ||
} | ||
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) | ||
}, | ||
} | ||
|
||
flags.AddTxFlagsToCmd(cmd) | ||
|
||
return cmd | ||
} |
Oops, something went wrong.