Skip to content

Commit

Permalink
feat(#242): Next wave
Browse files Browse the repository at this point in the history
  • Loading branch information
lxgr-linux committed Dec 16, 2024
1 parent 7d1780e commit 1cc00e8
Show file tree
Hide file tree
Showing 22 changed files with 9,573 additions and 778 deletions.
2,478 changes: 2,478 additions & 0 deletions api/cardchain/cardchain/council.pulsar.go

Large diffs are not rendered by default.

4,399 changes: 3,808 additions & 591 deletions api/cardchain/cardchain/tx.pulsar.go

Large diffs are not rendered by default.

163 changes: 137 additions & 26 deletions api/cardchain/cardchain/tx_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/static/openapi.yml

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions proto/cardchain/cardchain/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import "cardchain/cardchain/params.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cardchain/cardchain/voting.proto";
import "cardchain/cardchain/match.proto";
import "cardchain/cardchain/council.proto";
import "cardchain/cardchain/card.proto";

option go_package = "github.com/DecentralCardGame/cardchain/x/cardchain/types";

Expand Down Expand Up @@ -50,6 +52,11 @@ service Msg {
rpc SellOfferCreate(MsgSellOfferCreate) returns (MsgSellOfferCreateResponse);
rpc SellOfferBuy(MsgSellOfferBuy) returns (MsgSellOfferBuyResponse);
rpc SellOfferRemove(MsgSellOfferRemove) returns (MsgSellOfferRemoveResponse);
rpc CardRaritySet(MsgCardRaritySet) returns (MsgCardRaritySetResponse);
rpc CouncilResponseCommit(MsgCouncilResponseCommit)
returns (MsgCouncilResponseCommitResponse);
rpc CouncilResponseReveal(MsgCouncilResponseReveal)
returns (MsgCouncilResponseRevealResponse);
}
// MsgUpdateParams is the Msg/UpdateParams request type.
message MsgUpdateParams {
Expand Down Expand Up @@ -291,3 +298,33 @@ message MsgSellOfferRemove {
}

message MsgSellOfferRemoveResponse {}

message MsgCardRaritySet {
option (cosmos.msg.v1.signer) = "creator";
string creator = 1;
uint64 cardId = 2;
uint64 setId = 3;
CardRarity rarity = 4;
}

message MsgCardRaritySetResponse {}

message MsgCouncilResponseCommit {
option (cosmos.msg.v1.signer) = "creator";
string creator = 1;
uint64 councilId = 2;
string reponse = 3;
string suggestion = 4;
}

message MsgCouncilResponseCommitResponse {}

message MsgCouncilResponseReveal {
option (cosmos.msg.v1.signer) = "creator";
string creator = 1;
uint64 councilId = 2;
Response reponse = 3;
string secret = 4;
}

message MsgCouncilResponseRevealResponse {}
17 changes: 17 additions & 0 deletions x/cardchain/keeper/msg_server_card_rarity_set.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package keeper

import (
"context"

"github.com/DecentralCardGame/cardchain/x/cardchain/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)

func (k msgServer) CardRaritySet(goCtx context.Context, msg *types.MsgCardRaritySet) (*types.MsgCardRaritySetResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

// TODO: Handling the message
_ = ctx

return &types.MsgCardRaritySetResponse{}, nil
}
17 changes: 17 additions & 0 deletions x/cardchain/keeper/msg_server_council_response_commit.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package keeper

import (
"context"

"github.com/DecentralCardGame/cardchain/x/cardchain/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)

func (k msgServer) CouncilResponseCommit(goCtx context.Context, msg *types.MsgCouncilResponseCommit) (*types.MsgCouncilResponseCommitResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

// TODO: Handling the message
_ = ctx

return &types.MsgCouncilResponseCommitResponse{}, nil
}
17 changes: 17 additions & 0 deletions x/cardchain/keeper/msg_server_council_response_reveal.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package keeper

import (
"context"

"github.com/DecentralCardGame/cardchain/x/cardchain/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)

func (k msgServer) CouncilResponseReveal(goCtx context.Context, msg *types.MsgCouncilResponseReveal) (*types.MsgCouncilResponseRevealResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

// TODO: Handling the message
_ = ctx

return &types.MsgCouncilResponseRevealResponse{}, nil
}
18 changes: 18 additions & 0 deletions x/cardchain/module/autocli.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,24 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
Short: "Send a SellOfferRemove tx",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "sellOfferId"}},
},
{
RpcMethod: "CardRaritySet",
Use: "card-rarity-set [card-id] [set-id] [rarity]",
Short: "Send a CardRaritySet tx",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "cardId"}, {ProtoField: "setId"}, {ProtoField: "rarity"}},
},
{
RpcMethod: "CouncilResponseCommit",
Use: "council-response-commit [council-id] [reponse] [suggestion]",
Short: "Send a CouncilResponseCommit tx",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "councilId"}, {ProtoField: "reponse"}, {ProtoField: "suggestion"}},
},
{
RpcMethod: "CouncilResponseReveal",
Use: "council-response-reveal [council-id] [reponse] [secret]",
Short: "Send a CouncilResponseReveal tx",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "councilId"}, {ProtoField: "reponse"}, {ProtoField: "secret"}},
},
// this line is used by ignite scaffolding # autocli/tx
},
},
Expand Down
Loading

0 comments on commit 1cc00e8

Please sign in to comment.