rename committee to council

This commit is contained in:
Solovyov1796 2024-04-25 14:13:27 +08:00
parent d83175fee3
commit d9f60f1dde
33 changed files with 520 additions and 520 deletions

View File

@ -179,7 +179,7 @@ func TestAppImportExport(t *testing.T) {
{app.keys[kavadist.StoreKey], newApp.keys[kavadist.StoreKey], [][]byte{}},
{app.keys[pricefeed.StoreKey], newApp.keys[pricefeed.StoreKey], [][]byte{}},
{app.keys[validatorvesting.StoreKey], newApp.keys[validatorvesting.StoreKey], [][]byte{}},
{app.keys[committee.StoreKey], newApp.keys[committee.StoreKey], [][]byte{}},
{app.keys[council.StoreKey], newApp.keys[council.StoreKey], [][]byte{}},
{app.keys[swap.StoreKey], newApp.keys[swap.StoreKey], [][]byte{}},
}

View File

@ -108,9 +108,9 @@ import (
evmutilkeeper "github.com/0glabs/0g-chain/x/evmutil/keeper"
evmutiltypes "github.com/0glabs/0g-chain/x/evmutil/types"
committee "github.com/0glabs/0g-chain/x/committee/v1"
committeekeeper "github.com/0glabs/0g-chain/x/committee/v1/keeper"
committeetypes "github.com/0glabs/0g-chain/x/committee/v1/types"
council "github.com/0glabs/0g-chain/x/council/v1"
councilkeeper "github.com/0glabs/0g-chain/x/council/v1/keeper"
counciltypes "github.com/0glabs/0g-chain/x/council/v1/types"
das "github.com/0glabs/0g-chain/x/das/v1"
daskeeper "github.com/0glabs/0g-chain/x/das/v1/keeper"
dastypes "github.com/0glabs/0g-chain/x/das/v1/types"
@ -154,7 +154,7 @@ var (
evmutil.AppModuleBasic{},
mint.AppModuleBasic{},
consensus.AppModuleBasic{},
committee.AppModuleBasic{},
council.AppModuleBasic{},
das.AppModuleBasic{},
)
@ -232,7 +232,7 @@ type App struct {
transferKeeper ibctransferkeeper.Keeper
mintKeeper mintkeeper.Keeper
consensusParamsKeeper consensusparamkeeper.Keeper
CommitteeKeeper committeekeeper.Keeper
CouncilKeeper councilkeeper.Keeper
DasKeeper daskeeper.Keeper
// make scoped keepers public for test purposes
@ -289,7 +289,7 @@ func NewApp(
minttypes.StoreKey,
consensusparamtypes.StoreKey,
crisistypes.StoreKey,
committeetypes.StoreKey,
counciltypes.StoreKey,
dastypes.StoreKey,
)
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey, evmtypes.TransientKey, feemarkettypes.TransientKey)
@ -510,7 +510,7 @@ func NewApp(
))
// create gov keeper with router
// NOTE this must be done after any keepers referenced in the gov router (ie committee) are defined
// NOTE this must be done after any keepers referenced in the gov router (ie council) are defined
govRouter := govv1beta1.NewRouter()
govRouter.
AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler).
@ -532,8 +532,8 @@ func NewApp(
govKeeper.SetLegacyRouter(govRouter)
app.govKeeper = *govKeeper
app.CommitteeKeeper = committeekeeper.NewKeeper(
keys[committeetypes.StoreKey], appCodec, app.stakingKeeper,
app.CouncilKeeper = councilkeeper.NewKeeper(
keys[counciltypes.StoreKey], appCodec, app.stakingKeeper,
)
app.DasKeeper = daskeeper.NewKeeper(keys[dastypes.StoreKey], appCodec, app.stakingKeeper)
@ -597,7 +597,7 @@ func NewApp(
consensusparamtypes.ModuleName,
packetforwardtypes.ModuleName,
committeetypes.ModuleName,
counciltypes.ModuleName,
dastypes.ModuleName,
)
@ -628,7 +628,7 @@ func NewApp(
minttypes.ModuleName,
consensusparamtypes.ModuleName,
packetforwardtypes.ModuleName,
committeetypes.ModuleName,
counciltypes.ModuleName,
dastypes.ModuleName,
)
@ -658,7 +658,7 @@ func NewApp(
consensusparamtypes.ModuleName,
packetforwardtypes.ModuleName,
crisistypes.ModuleName, // runs the invariants at genesis, should run after other modules
committeetypes.ModuleName,
counciltypes.ModuleName,
dastypes.ModuleName,
)

View File

@ -23,5 +23,5 @@ const (
DefaultWeightMsgRedeem int = 20
DefaultWeightMsgBlock int = 20
DefaultWeightMsgPause int = 20
OpWeightSubmitCommitteeChangeProposal int = 20
OpWeightSubmitCouncilChangeProposal int = 20
)

View File

@ -24,7 +24,7 @@ import (
evmtypes "github.com/evmos/ethermint/x/evm/types"
feemarkettypes "github.com/evmos/ethermint/x/feemarket/types"
committeetypes "github.com/0glabs/0g-chain/x/committee/v1/types"
counciltypes "github.com/0glabs/0g-chain/x/council/v1/types"
dastypes "github.com/0glabs/0g-chain/x/das/v1/types"
evmutiltypes "github.com/0glabs/0g-chain/x/evmutil/types"
)
@ -58,7 +58,7 @@ type QueryClient struct {
// 0g-chain module query clients
Committee committeetypes.QueryClient
Council counciltypes.QueryClient
Das dastypes.QueryClient
Evmutil evmutiltypes.QueryClient
}
@ -91,7 +91,7 @@ func NewQueryClient(grpcEndpoint string) (*QueryClient, error) {
IbcClient: ibcclienttypes.NewQueryClient(conn),
IbcTransfer: ibctransfertypes.NewQueryClient(conn),
Committee: committeetypes.NewQueryClient(conn),
Council: counciltypes.NewQueryClient(conn),
Das: dastypes.NewQueryClient(conn),
Evmutil: evmutiltypes.NewQueryClient(conn),
}

View File

@ -56,7 +56,7 @@ func TestNewQueryClient_ValidClient(t *testing.T) {
// validate 0gChain clients
require.NotNil(t, client.Evmutil)
require.NotNil(t, client.Committee)
require.NotNil(t, client.Council)
require.NotNil(t, client.Das)
})
}

View File

@ -1,34 +0,0 @@
syntax = "proto3";
package zgc.committee.v1;
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto";
import "zgc/committee/v1/genesis.proto";
option go_package = "github.com/0glabs/0g-chain/x/committee/v1/types";
option (gogoproto.goproto_getters_all) = false;
// Query defines the gRPC querier service for committee module
service Query {
rpc CurrentCommitteeID(QueryCurrentCommitteeIDRequest) returns (QueryCurrentCommitteeIDResponse) {
option (google.api.http).get = "/0gchain/committee/v1/current-committee-id";
}
rpc RegisteredVoters(QueryRegisteredVotersRequest) returns (QueryRegisteredVotersResponse) {
option (google.api.http).get = "/0gchain/committee/v1/registered-voters";
}
}
message QueryCurrentCommitteeIDRequest {}
message QueryCurrentCommitteeIDResponse {
uint64 current_committee_id = 1 [(gogoproto.customname) = "CurrentCommitteeID"];
}
message QueryRegisteredVotersRequest {}
message QueryRegisteredVotersResponse {
repeated string voters = 1;
}

View File

@ -1,29 +1,29 @@
syntax = "proto3";
package zgc.committee.v1;
package zgc.council.v1;
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto";
option go_package = "github.com/0glabs/0g-chain/x/committee/v1/types";
option go_package = "github.com/0glabs/0g-chain/x/council/v1/types";
message Params {
uint64 committee_size = 1;
uint64 council_size = 1;
}
// GenesisState defines the committee module's genesis state.
// GenesisState defines the council module's genesis state.
message GenesisState {
option (gogoproto.goproto_getters) = false;
Params params = 1 [(gogoproto.nullable) = false];
uint64 voting_start_height = 2;
uint64 voting_period = 3;
uint64 current_committee_id = 4 [(gogoproto.customname) = "CurrentCommitteeID"];
repeated Committee committees = 5 [(gogoproto.nullable) = false];
uint64 current_council_id = 4 [(gogoproto.customname) = "CurrentCouncilID"];
repeated Council councils = 5 [(gogoproto.nullable) = false];
}
message Committee {
message Council {
uint64 id = 1 [(gogoproto.customname) = "ID"];
uint64 voting_start_height = 2;
uint64 start_height = 3;
@ -38,7 +38,7 @@ message Committee {
message Vote {
option (gogoproto.goproto_getters) = false;
uint64 committee_id = 1 [(gogoproto.customname) = "CommitteeID"];
uint64 council_id = 1 [(gogoproto.customname) = "CouncilID"];
bytes voter = 2 [
(cosmos_proto.scalar) = "cosmos.AddressBytes",
(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress"

View File

@ -0,0 +1,34 @@
syntax = "proto3";
package zgc.council.v1;
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto";
import "zgc/council/v1/genesis.proto";
option go_package = "github.com/0glabs/0g-chain/x/council/v1/types";
option (gogoproto.goproto_getters_all) = false;
// Query defines the gRPC querier service for council module
service Query {
rpc CurrentCouncilID(QueryCurrentCouncilIDRequest) returns (QueryCurrentCouncilIDResponse) {
option (google.api.http).get = "/0gchain/council/v1/current-council-id";
}
rpc RegisteredVoters(QueryRegisteredVotersRequest) returns (QueryRegisteredVotersResponse) {
option (google.api.http).get = "/0gchain/council/v1/registered-voters";
}
}
message QueryCurrentCouncilIDRequest {}
message QueryCurrentCouncilIDResponse {
uint64 current_council_id = 1 [(gogoproto.customname) = "CurrentCouncilID"];
}
message QueryRegisteredVotersRequest {}
message QueryRegisteredVotersResponse {
repeated string voters = 1;
}

View File

@ -1,15 +1,15 @@
syntax = "proto3";
package zgc.committee.v1;
package zgc.council.v1;
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "google/protobuf/any.proto";
import "zgc/committee/v1/genesis.proto";
import "zgc/council/v1/genesis.proto";
option go_package = "github.com/0glabs/0g-chain/x/committee/v1/types";
option go_package = "github.com/0glabs/0g-chain/x/council/v1/types";
option (gogoproto.goproto_getters_all) = false;
// Msg defines the committee Msg service
// Msg defines the council Msg service
service Msg {
rpc Register(MsgRegister) returns (MsgRegisterResponse);
rpc Vote(MsgVote) returns (MsgVoteResponse);
@ -23,7 +23,7 @@ message MsgRegister {
message MsgRegisterResponse {}
message MsgVote {
uint64 committee_id = 1 [(gogoproto.customname) = "CommitteeID"];
uint64 council_id = 1 [(gogoproto.customname) = "CouncilID"];
string voter = 2;
repeated Ballot ballots = 3;
}

View File

@ -1,21 +0,0 @@
package types
import (
sdk "github.com/cosmos/cosmos-sdk/types"
)
type Committees []Committee
type Votes []Vote
func (c Committee) HasVotingEndedBy(height int64) bool {
return height >= int64(c.StartHeight)
}
// NewVote instantiates a new instance of Vote
func NewVote(committeeID uint64, voter sdk.ValAddress, ballots []*Ballot) Vote {
return Vote{
CommitteeID: committeeID,
Voter: voter,
Ballots: ballots,
}
}

View File

@ -7,7 +7,7 @@ import (
"github.com/spf13/cobra"
"github.com/0glabs/0g-chain/x/committee/v1/types"
"github.com/0glabs/0g-chain/x/council/v1/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
)
@ -16,24 +16,24 @@ import (
func GetQueryCmd() *cobra.Command {
cmd := &cobra.Command{
Use: types.ModuleName,
Short: "Querying commands for the committee module",
Short: "Querying commands for the council module",
DisableFlagParsing: true,
SuggestionsMinimumDistance: 2,
RunE: client.ValidateCmd,
}
cmd.AddCommand(
GetCurrentCommitteeID(),
GetCurrentCouncilID(),
GetRegisteredVoters(),
)
return cmd
}
func GetCurrentCommitteeID() *cobra.Command {
func GetCurrentCouncilID() *cobra.Command {
cmd := &cobra.Command{
Use: "current-committee-id",
Short: "Query the current committee ID",
Use: "current-council-id",
Short: "Query the current council ID",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, _ []string) error {
clientCtx, err := client.GetClientQueryContext(cmd)
@ -43,13 +43,13 @@ func GetCurrentCommitteeID() *cobra.Command {
queryClient := types.NewQueryClient(clientCtx)
params := &types.QueryCurrentCommitteeIDRequest{}
res, err := queryClient.CurrentCommitteeID(context.Background(), params)
params := &types.QueryCurrentCouncilIDRequest{}
res, err := queryClient.CurrentCouncilID(context.Background(), params)
if err != nil {
return err
}
return clientCtx.PrintString(fmt.Sprintf("%v\n", res.CurrentCommitteeID))
return clientCtx.PrintString(fmt.Sprintf("%v\n", res.CurrentCouncilID))
},
}

View File

@ -10,7 +10,7 @@ import (
sdkmath "cosmossdk.io/math"
"github.com/0glabs/0g-chain/crypto/vrf"
"github.com/0glabs/0g-chain/x/committee/v1/types"
"github.com/0glabs/0g-chain/x/council/v1/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/tx"
@ -117,7 +117,7 @@ func NewRegisterCmd() *cobra.Command {
func NewVoteCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "vote committee-id",
Use: "vote council-id",
Short: "Vote on a proposal",
Args: cobra.MinimumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
@ -151,12 +151,12 @@ func NewVoteCmd() *cobra.Command {
}
sk := vrfalgo.PrivateKey(voterRecord.GetLocal().PrivKey.Value)
committeeID, err := strconv.ParseUint(args[0], 10, 64)
councilID, err := strconv.ParseUint(args[0], 10, 64)
if err != nil {
return err
}
votingStartHeight := types.DefaultVotingStartHeight + (committeeID-1)*types.DefaultVotingPeriod
votingStartHeight := types.DefaultVotingStartHeight + (councilID-1)*types.DefaultVotingPeriod
rsp, err := stakingtypes.NewQueryClient(clientCtx).HistoricalInfo(cmd.Context(), &stakingtypes.QueryHistoricalInfoRequest{Height: int64(votingStartHeight)})
if err != nil {
@ -183,7 +183,7 @@ func NewVoteCmd() *cobra.Command {
}
msg := &types.MsgVote{
CommitteeID: committeeID,
CouncilID: councilID,
Voter: valAddr.String(),
Ballots: ballots,
}

View File

@ -1,4 +1,4 @@
package committee
package council
import (
"fmt"
@ -6,8 +6,8 @@ import (
errorsmod "cosmossdk.io/errors"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/0glabs/0g-chain/x/committee/v1/keeper"
"github.com/0glabs/0g-chain/x/committee/v1/types"
"github.com/0glabs/0g-chain/x/council/v1/keeper"
"github.com/0glabs/0g-chain/x/council/v1/types"
)
// InitGenesis initializes the store state from a genesis state.
@ -22,10 +22,10 @@ func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, gs types.GenesisState) {
panic(errorsmod.Wrapf(err, "error setting params"))
}
keeper.SetCurrentCommitteeID(ctx, gs.CurrentCommitteeID)
keeper.SetCurrentCouncilID(ctx, gs.CurrentCouncilID)
for _, p := range gs.Committees {
keeper.SetCommittee(ctx, p)
for _, p := range gs.Councils {
keeper.SetCouncil(ctx, p)
}
}
@ -41,7 +41,7 @@ func ExportGenesis(ctx sdk.Context, keeper keeper.Keeper) *types.GenesisState {
panic(err)
}
currentID, err := keeper.GetCurrentCommitteeID(ctx)
currentID, err := keeper.GetCurrentCouncilID(ctx)
if err != nil {
panic(err)
}
@ -51,6 +51,6 @@ func ExportGenesis(ctx sdk.Context, keeper keeper.Keeper) *types.GenesisState {
startHeight,
period,
currentID,
keeper.GetCommittees(ctx),
keeper.GetCouncils(ctx),
)
}

View File

@ -13,36 +13,36 @@ type Ballot struct {
}
func (k *Keeper) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) {
committeeID, err := k.GetCurrentCommitteeID(ctx)
councilID, err := k.GetCurrentCouncilID(ctx)
if err != nil {
// TODO: handle the case where committeeID is not available
// TODO: handle the case where councilID is not available
return
}
committee, bz := k.GetCommittee(ctx, committeeID)
council, bz := k.GetCouncil(ctx, councilID)
if !bz {
return
}
if ctx.BlockHeight() >= int64(committee.StartHeight) {
// We are ready to accept votes for the next committee
if err := k.StoreNewCommittee(ctx, committee.StartHeight); err != nil {
if ctx.BlockHeight() >= int64(council.StartHeight) {
// We are ready to accept votes for the next council
if err := k.StoreNewCouncil(ctx, council.StartHeight); err != nil {
return
}
}
if ctx.BlockHeight() < int64(committee.EndHeight) {
if ctx.BlockHeight() < int64(council.EndHeight) {
return
}
k.IncrementCurrentCommitteeID(ctx)
committee, bz = k.GetCommittee(ctx, committeeID+1)
k.IncrementCurrentCouncilID(ctx)
council, bz = k.GetCouncil(ctx, councilID+1)
if !bz {
return
}
ballots := []Ballot{}
seen := make(map[string]struct{})
for _, vote := range committee.Votes {
for _, vote := range council.Votes {
for _, ballot := range vote.Ballots {
ballot := Ballot{
voter: vote.Voter,
@ -59,13 +59,13 @@ func (k *Keeper) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) {
return ballots[i].content < ballots[j].content
})
committeeSize := k.GetParams(ctx).CommitteeSize
committee.Members = make([]sdk.ValAddress, committeeSize)
for i := 0; i < int(committeeSize); i = i + 1 {
committee.Members[i] = ballots[i].voter
councilSize := k.GetParams(ctx).CouncilSize
council.Members = make([]sdk.ValAddress, councilSize)
for i := 0; i < int(councilSize); i = i + 1 {
council.Members[i] = ballots[i].voter
}
k.SetCommittee(ctx, committee)
k.SetCouncil(ctx, council)
}
func (k *Keeper) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) {

View File

@ -3,22 +3,22 @@ package keeper
import (
"context"
"github.com/0glabs/0g-chain/x/committee/v1/types"
"github.com/0glabs/0g-chain/x/council/v1/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)
var _ types.QueryServer = Keeper{}
func (k Keeper) CurrentCommitteeID(
func (k Keeper) CurrentCouncilID(
c context.Context,
_ *types.QueryCurrentCommitteeIDRequest,
) (*types.QueryCurrentCommitteeIDResponse, error) {
_ *types.QueryCurrentCouncilIDRequest,
) (*types.QueryCurrentCouncilIDResponse, error) {
ctx := sdk.UnwrapSDKContext(c)
currentCommitteeID, err := k.GetCurrentCommitteeID(ctx)
currentCouncilID, err := k.GetCurrentCouncilID(ctx)
if err != nil {
return nil, err
}
return &types.QueryCurrentCommitteeIDResponse{CurrentCommitteeID: currentCommitteeID}, nil
return &types.QueryCurrentCouncilIDResponse{CurrentCouncilID: currentCouncilID}, nil
}
func (k Keeper) RegisteredVoters(

View File

@ -11,7 +11,7 @@ import (
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/0glabs/0g-chain/x/committee/v1/types"
"github.com/0glabs/0g-chain/x/council/v1/types"
)
// Keeper of the inflation store
@ -40,29 +40,29 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger {
}
// ------------------------------------------
// Committees
// Councils
// ------------------------------------------
func (k Keeper) SetCurrentCommitteeID(ctx sdk.Context, id uint64) {
func (k Keeper) SetCurrentCouncilID(ctx sdk.Context, id uint64) {
store := ctx.KVStore(k.storeKey)
store.Set(types.CurrentCommitteeIDKey, types.GetKeyFromID(id))
store.Set(types.CurrentCouncilIDKey, types.GetKeyFromID(id))
}
func (k Keeper) GetCurrentCommitteeID(ctx sdk.Context) (uint64, error) {
func (k Keeper) GetCurrentCouncilID(ctx sdk.Context) (uint64, error) {
store := ctx.KVStore(k.storeKey)
bz := store.Get(types.CurrentCommitteeIDKey)
bz := store.Get(types.CurrentCouncilIDKey)
if bz == nil {
return 0, errorsmod.Wrap(types.ErrInvalidGenesis, "current committee ID not set at genesis")
return 0, errorsmod.Wrap(types.ErrInvalidGenesis, "current council ID not set at genesis")
}
return types.Uint64FromBytes(bz), nil
}
func (k Keeper) IncrementCurrentCommitteeID(ctx sdk.Context) error {
id, err := k.GetCurrentCommitteeID(ctx)
func (k Keeper) IncrementCurrentCouncilID(ctx sdk.Context) error {
id, err := k.GetCurrentCouncilID(ctx)
if err != nil {
return err
}
k.SetCurrentCommitteeID(ctx, id+1)
k.SetCurrentCouncilID(ctx, id+1)
return nil
}
@ -94,9 +94,9 @@ func (k Keeper) GetVotingPeriod(ctx sdk.Context) (uint64, error) {
return types.Uint64FromBytes(bz), nil
}
// StoreNewCommittee stores a committee, adding a new ID
func (k Keeper) StoreNewCommittee(ctx sdk.Context, votingStartHeight uint64) error {
currentCommitteeID, err := k.GetCurrentCommitteeID(ctx)
// StoreNewCouncil stores a council, adding a new ID
func (k Keeper) StoreNewCouncil(ctx sdk.Context, votingStartHeight uint64) error {
currentCouncilID, err := k.GetCurrentCouncilID(ctx)
if err != nil {
return err
}
@ -105,35 +105,35 @@ func (k Keeper) StoreNewCommittee(ctx sdk.Context, votingStartHeight uint64) err
if err != nil {
return err
}
com := types.Committee{
ID: currentCommitteeID + 1,
com := types.Council{
ID: currentCouncilID + 1,
VotingStartHeight: votingStartHeight,
StartHeight: votingStartHeight + votingPeriod,
EndHeight: votingStartHeight + votingPeriod*2,
Votes: []types.Vote{},
Members: []sdk.ValAddress{},
}
k.SetCommittee(ctx, com)
k.SetCouncil(ctx, com)
return nil
}
func (k Keeper) GetCommittee(ctx sdk.Context, committeeID uint64) (types.Committee, bool) {
store := prefix.NewStore(ctx.KVStore(k.storeKey), types.CommitteeKeyPrefix)
bz := store.Get(types.GetKeyFromID(committeeID))
func (k Keeper) GetCouncil(ctx sdk.Context, councilID uint64) (types.Council, bool) {
store := prefix.NewStore(ctx.KVStore(k.storeKey), types.CouncilKeyPrefix)
bz := store.Get(types.GetKeyFromID(councilID))
if bz == nil {
return types.Committee{}, false
return types.Council{}, false
}
var com types.Committee
var com types.Council
k.cdc.MustUnmarshal(bz, &com)
return com, true
}
// SetCommittee puts a committee into the store.
func (k Keeper) SetCommittee(ctx sdk.Context, committee types.Committee) {
store := prefix.NewStore(ctx.KVStore(k.storeKey), types.CommitteeKeyPrefix)
bz := k.cdc.MustMarshal(&committee)
store.Set(types.GetKeyFromID(committee.ID), bz)
// SetCouncil puts a council into the store.
func (k Keeper) SetCouncil(ctx sdk.Context, council types.Council) {
store := prefix.NewStore(ctx.KVStore(k.storeKey), types.CouncilKeyPrefix)
bz := k.cdc.MustMarshal(&council)
store.Set(types.GetKeyFromID(council.ID), bz)
}
// // DeleteProposal removes a proposal from the store.
@ -144,22 +144,22 @@ func (k Keeper) SetCommittee(ctx sdk.Context, committee types.Committee) {
// IterateProposals provides an iterator over all stored proposals.
// For each proposal, cb will be called. If cb returns true, the iterator will close and stop.
func (k Keeper) IterateCommittee(ctx sdk.Context, cb func(proposal types.Committee) (stop bool)) {
iterator := sdk.KVStorePrefixIterator(ctx.KVStore(k.storeKey), types.CommitteeKeyPrefix)
func (k Keeper) IterateCouncil(ctx sdk.Context, cb func(proposal types.Council) (stop bool)) {
iterator := sdk.KVStorePrefixIterator(ctx.KVStore(k.storeKey), types.CouncilKeyPrefix)
defer iterator.Close()
for ; iterator.Valid(); iterator.Next() {
var committee types.Committee
k.cdc.MustUnmarshal(iterator.Value(), &committee)
if cb(committee) {
var council types.Council
k.cdc.MustUnmarshal(iterator.Value(), &council)
if cb(council) {
break
}
}
}
func (k Keeper) GetCommittees(ctx sdk.Context) types.Committees {
results := types.Committees{}
k.IterateCommittee(ctx, func(prop types.Committee) bool {
func (k Keeper) GetCouncils(ctx sdk.Context) types.Councils {
results := types.Councils{}
k.IterateCouncil(ctx, func(prop types.Council) bool {
results = append(results, prop)
return false
})
@ -195,13 +195,13 @@ func (k Keeper) GetVote(ctx sdk.Context, epochID uint64, voter sdk.ValAddress) (
func (k Keeper) SetVote(ctx sdk.Context, vote types.Vote) {
store := prefix.NewStore(ctx.KVStore(k.storeKey), types.VoteKeyPrefix)
bz := k.cdc.MustMarshal(&vote)
store.Set(types.GetVoteKey(vote.CommitteeID, vote.Voter), bz)
store.Set(types.GetVoteKey(vote.CouncilID, vote.Voter), bz)
}
// DeleteVote removes a Vote from the store.
func (k Keeper) DeleteVote(ctx sdk.Context, committeeID uint64, voter sdk.ValAddress) {
func (k Keeper) DeleteVote(ctx sdk.Context, councilID uint64, voter sdk.ValAddress) {
store := prefix.NewStore(ctx.KVStore(k.storeKey), types.VoteKeyPrefix)
store.Delete(types.GetVoteKey(committeeID, voter))
store.Delete(types.GetVoteKey(councilID, voter))
}
// IterateVotes provides an iterator over all stored votes.
@ -231,9 +231,9 @@ func (k Keeper) GetVotes(ctx sdk.Context) []types.Vote {
}
// GetVotesByProposal returns all votes for one proposal.
func (k Keeper) GetVotesByCommittee(ctx sdk.Context, committeeID uint64) []types.Vote {
func (k Keeper) GetVotesByCouncil(ctx sdk.Context, councilID uint64) []types.Vote {
results := []types.Vote{}
iterator := sdk.KVStorePrefixIterator(ctx.KVStore(k.storeKey), append(types.VoteKeyPrefix, types.GetKeyFromID(committeeID)...))
iterator := sdk.KVStorePrefixIterator(ctx.KVStore(k.storeKey), append(types.VoteKeyPrefix, types.GetKeyFromID(councilID)...))
defer iterator.Close()
for ; iterator.Valid(); iterator.Next() {
@ -294,11 +294,11 @@ func (k Keeper) AddVoter(ctx sdk.Context, voter sdk.ValAddress, key []byte) erro
return nil
}
func (k Keeper) AddVote(ctx sdk.Context, committeeID uint64, voter sdk.ValAddress, ballots []*types.Ballot) error {
func (k Keeper) AddVote(ctx sdk.Context, councilID uint64, voter sdk.ValAddress, ballots []*types.Ballot) error {
// Validate
com, found := k.GetCommittee(ctx, committeeID)
com, found := k.GetCouncil(ctx, councilID)
if !found {
return errorsmod.Wrapf(types.ErrUnknownCommittee, "%d", committeeID)
return errorsmod.Wrapf(types.ErrUnknownCouncil, "%d", councilID)
}
if com.HasVotingEndedBy(ctx.BlockHeight()) {
return errorsmod.Wrapf(types.ErrProposalExpired, "%d ≥ %d", ctx.BlockHeight(), com.StartHeight)
@ -308,12 +308,12 @@ func (k Keeper) AddVote(ctx sdk.Context, committeeID uint64, voter sdk.ValAddres
// TODO: verify whether ballots are valid or not
// Store vote, overwriting any prior vote
k.SetVote(ctx, types.NewVote(committeeID, voter, ballots))
k.SetVote(ctx, types.NewVote(councilID, voter, ballots))
ctx.EventManager().EmitEvent(
sdk.NewEvent(
types.EventTypeVote,
sdk.NewAttribute(types.AttributeKeyCommitteeID, fmt.Sprintf("%d", com.ID)),
sdk.NewAttribute(types.AttributeKeyCouncilID, fmt.Sprintf("%d", com.ID)),
sdk.NewAttribute(types.AttributeKeyVoter, voter.String()),
// TODO: types.AttributeKeyBallots
),

View File

@ -6,7 +6,7 @@ package keeper
import (
"context"
"github.com/0glabs/0g-chain/x/committee/v1/types"
"github.com/0glabs/0g-chain/x/council/v1/types"
sdk "github.com/cosmos/cosmos-sdk/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
)
@ -43,7 +43,7 @@ func (k Keeper) Vote(goCtx context.Context, msg *types.MsgVote) (*types.MsgVoteR
return nil, err
}
if err := k.AddVote(ctx, msg.CommitteeID, voter, msg.Ballots); err != nil {
if err := k.AddVote(ctx, msg.CouncilID, voter, msg.Ballots); err != nil {
return nil, err
}

View File

@ -1,7 +1,7 @@
package keeper
import (
"github.com/0glabs/0g-chain/x/committee/v1/types"
"github.com/0glabs/0g-chain/x/council/v1/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)

View File

@ -1,4 +1,4 @@
package committee
package council
import (
"context"
@ -17,12 +17,12 @@ import (
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"
"github.com/0glabs/0g-chain/x/committee/v1/client/cli"
"github.com/0glabs/0g-chain/x/committee/v1/keeper"
"github.com/0glabs/0g-chain/x/committee/v1/types"
"github.com/0glabs/0g-chain/x/council/v1/client/cli"
"github.com/0glabs/0g-chain/x/council/v1/keeper"
"github.com/0glabs/0g-chain/x/council/v1/types"
)
// consensusVersion defines the current x/committee module consensus version.
// consensusVersion defines the current x/council module consensus version.
const consensusVersion = 1
// type check to ensure the interface is properly implemented

View File

@ -21,8 +21,8 @@ var (
const (
// Amino names
registerName = "evmos/committee/MsgRegister"
voteName = "evmos/committee/MsgVote"
registerName = "evmos/council/MsgRegister"
voteName = "evmos/council/MsgVote"
)
// NOTE: This is required for the GetSignBytes function

View File

@ -0,0 +1,21 @@
package types
import (
sdk "github.com/cosmos/cosmos-sdk/types"
)
type Councils []Council
type Votes []Vote
func (c Council) HasVotingEndedBy(height int64) bool {
return height >= int64(c.StartHeight)
}
// NewVote instantiates a new instance of Vote
func NewVote(councilID uint64, voter sdk.ValAddress, ballots []*Ballot) Vote {
return Vote{
CouncilID: councilID,
Voter: voter,
Ballots: ballots,
}
}

View File

@ -3,8 +3,8 @@ package types
import errorsmod "cosmossdk.io/errors"
var (
ErrUnknownCommittee = errorsmod.Register(ModuleName, 2, "committee not found")
ErrInvalidCommittee = errorsmod.Register(ModuleName, 3, "invalid committee")
ErrUnknownCouncil = errorsmod.Register(ModuleName, 2, "council not found")
ErrInvalidCouncil = errorsmod.Register(ModuleName, 3, "invalid council")
ErrUnknownProposal = errorsmod.Register(ModuleName, 4, "proposal not found")
ErrProposalExpired = errorsmod.Register(ModuleName, 5, "proposal expired")
ErrInvalidPubProposal = errorsmod.Register(ModuleName, 6, "invalid pubproposal")

View File

@ -5,8 +5,8 @@ const (
EventTypeRegister = "register"
EventTypeVote = "vote"
AttributeValueCategory = "committee"
AttributeKeyCommitteeID = "committee_id"
AttributeValueCategory = "council"
AttributeKeyCouncilID = "council_id"
AttributeKeyProposalID = "proposal_id"
AttributeKeyVotingStartHeight = "voting_start_height"
AttributeKeyVotingEndHeight = "voting_end_height"

View File

@ -6,13 +6,13 @@ const (
)
// NewGenesisState returns a new genesis state object for the module.
func NewGenesisState(params Params, votingStartHeight uint64, votingPeriod uint64, currentCommitteeID uint64, committees Committees) *GenesisState {
func NewGenesisState(params Params, votingStartHeight uint64, votingPeriod uint64, currentCouncilID uint64, councils Councils) *GenesisState {
return &GenesisState{
Params: params,
VotingStartHeight: votingStartHeight,
VotingPeriod: votingPeriod,
CurrentCommitteeID: currentCommitteeID,
Committees: committees,
CurrentCouncilID: currentCouncilID,
Councils: councils,
}
}
@ -20,12 +20,12 @@ func NewGenesisState(params Params, votingStartHeight uint64, votingPeriod uint6
func DefaultGenesisState() *GenesisState {
return NewGenesisState(
Params{
CommitteeSize: 1,
CouncilSize: 1,
},
DefaultVotingStartHeight,
DefaultVotingPeriod,
1,
[]Committee{
[]Council{
{
ID: 1,
VotingStartHeight: DefaultVotingStartHeight,

View File

@ -1,5 +1,5 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: zgc/committee/v1/genesis.proto
// source: zgc/council/v1/genesis.proto
package types
@ -28,14 +28,14 @@ var _ = math.Inf
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type Params struct {
CommitteeSize uint64 `protobuf:"varint,1,opt,name=committee_size,json=committeeSize,proto3" json:"committee_size,omitempty"`
CouncilSize uint64 `protobuf:"varint,1,opt,name=council_size,json=councilSize,proto3" json:"council_size,omitempty"`
}
func (m *Params) Reset() { *m = Params{} }
func (m *Params) String() string { return proto.CompactTextString(m) }
func (*Params) ProtoMessage() {}
func (*Params) Descriptor() ([]byte, []int) {
return fileDescriptor_8ed77f46b627050b, []int{0}
return fileDescriptor_35f7661c22f951dd, []int{0}
}
func (m *Params) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -64,27 +64,27 @@ func (m *Params) XXX_DiscardUnknown() {
var xxx_messageInfo_Params proto.InternalMessageInfo
func (m *Params) GetCommitteeSize() uint64 {
func (m *Params) GetCouncilSize() uint64 {
if m != nil {
return m.CommitteeSize
return m.CouncilSize
}
return 0
}
// GenesisState defines the committee module's genesis state.
// GenesisState defines the council module's genesis state.
type GenesisState struct {
Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
VotingStartHeight uint64 `protobuf:"varint,2,opt,name=voting_start_height,json=votingStartHeight,proto3" json:"voting_start_height,omitempty"`
VotingPeriod uint64 `protobuf:"varint,3,opt,name=voting_period,json=votingPeriod,proto3" json:"voting_period,omitempty"`
CurrentCommitteeID uint64 `protobuf:"varint,4,opt,name=current_committee_id,json=currentCommitteeId,proto3" json:"current_committee_id,omitempty"`
Committees []Committee `protobuf:"bytes,5,rep,name=committees,proto3" json:"committees"`
CurrentCouncilID uint64 `protobuf:"varint,4,opt,name=current_council_id,json=currentCouncilId,proto3" json:"current_council_id,omitempty"`
Councils []Council `protobuf:"bytes,5,rep,name=councils,proto3" json:"councils"`
}
func (m *GenesisState) Reset() { *m = GenesisState{} }
func (m *GenesisState) String() string { return proto.CompactTextString(m) }
func (*GenesisState) ProtoMessage() {}
func (*GenesisState) Descriptor() ([]byte, []int) {
return fileDescriptor_8ed77f46b627050b, []int{1}
return fileDescriptor_35f7661c22f951dd, []int{1}
}
func (m *GenesisState) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -113,7 +113,7 @@ func (m *GenesisState) XXX_DiscardUnknown() {
var xxx_messageInfo_GenesisState proto.InternalMessageInfo
type Committee struct {
type Council struct {
ID uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
VotingStartHeight uint64 `protobuf:"varint,2,opt,name=voting_start_height,json=votingStartHeight,proto3" json:"voting_start_height,omitempty"`
StartHeight uint64 `protobuf:"varint,3,opt,name=start_height,json=startHeight,proto3" json:"start_height,omitempty"`
@ -122,18 +122,18 @@ type Committee struct {
Members []github_com_cosmos_cosmos_sdk_types.ValAddress `protobuf:"bytes,6,rep,name=members,proto3,casttype=github.com/cosmos/cosmos-sdk/types.ValAddress" json:"members,omitempty"`
}
func (m *Committee) Reset() { *m = Committee{} }
func (m *Committee) String() string { return proto.CompactTextString(m) }
func (*Committee) ProtoMessage() {}
func (*Committee) Descriptor() ([]byte, []int) {
return fileDescriptor_8ed77f46b627050b, []int{2}
func (m *Council) Reset() { *m = Council{} }
func (m *Council) String() string { return proto.CompactTextString(m) }
func (*Council) ProtoMessage() {}
func (*Council) Descriptor() ([]byte, []int) {
return fileDescriptor_35f7661c22f951dd, []int{2}
}
func (m *Committee) XXX_Unmarshal(b []byte) error {
func (m *Council) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Committee) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
func (m *Council) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Committee.Marshal(b, m, deterministic)
return xxx_messageInfo_Council.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
@ -143,54 +143,54 @@ func (m *Committee) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return b[:n], nil
}
}
func (m *Committee) XXX_Merge(src proto.Message) {
xxx_messageInfo_Committee.Merge(m, src)
func (m *Council) XXX_Merge(src proto.Message) {
xxx_messageInfo_Council.Merge(m, src)
}
func (m *Committee) XXX_Size() int {
func (m *Council) XXX_Size() int {
return m.Size()
}
func (m *Committee) XXX_DiscardUnknown() {
xxx_messageInfo_Committee.DiscardUnknown(m)
func (m *Council) XXX_DiscardUnknown() {
xxx_messageInfo_Council.DiscardUnknown(m)
}
var xxx_messageInfo_Committee proto.InternalMessageInfo
var xxx_messageInfo_Council proto.InternalMessageInfo
func (m *Committee) GetID() uint64 {
func (m *Council) GetID() uint64 {
if m != nil {
return m.ID
}
return 0
}
func (m *Committee) GetVotingStartHeight() uint64 {
func (m *Council) GetVotingStartHeight() uint64 {
if m != nil {
return m.VotingStartHeight
}
return 0
}
func (m *Committee) GetStartHeight() uint64 {
func (m *Council) GetStartHeight() uint64 {
if m != nil {
return m.StartHeight
}
return 0
}
func (m *Committee) GetEndHeight() uint64 {
func (m *Council) GetEndHeight() uint64 {
if m != nil {
return m.EndHeight
}
return 0
}
func (m *Committee) GetVotes() []Vote {
func (m *Council) GetVotes() []Vote {
if m != nil {
return m.Votes
}
return nil
}
func (m *Committee) GetMembers() []github_com_cosmos_cosmos_sdk_types.ValAddress {
func (m *Council) GetMembers() []github_com_cosmos_cosmos_sdk_types.ValAddress {
if m != nil {
return m.Members
}
@ -198,7 +198,7 @@ func (m *Committee) GetMembers() []github_com_cosmos_cosmos_sdk_types.ValAddress
}
type Vote struct {
CommitteeID uint64 `protobuf:"varint,1,opt,name=committee_id,json=committeeId,proto3" json:"committee_id,omitempty"`
CouncilID uint64 `protobuf:"varint,1,opt,name=council_id,json=councilId,proto3" json:"council_id,omitempty"`
Voter github_com_cosmos_cosmos_sdk_types.ValAddress `protobuf:"bytes,2,opt,name=voter,proto3,casttype=github.com/cosmos/cosmos-sdk/types.ValAddress" json:"voter,omitempty"`
Ballots []*Ballot `protobuf:"bytes,3,rep,name=ballots,proto3" json:"ballots,omitempty"`
}
@ -207,7 +207,7 @@ func (m *Vote) Reset() { *m = Vote{} }
func (m *Vote) String() string { return proto.CompactTextString(m) }
func (*Vote) ProtoMessage() {}
func (*Vote) Descriptor() ([]byte, []int) {
return fileDescriptor_8ed77f46b627050b, []int{3}
return fileDescriptor_35f7661c22f951dd, []int{3}
}
func (m *Vote) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -245,7 +245,7 @@ func (m *Ballot) Reset() { *m = Ballot{} }
func (m *Ballot) String() string { return proto.CompactTextString(m) }
func (*Ballot) ProtoMessage() {}
func (*Ballot) Descriptor() ([]byte, []int) {
return fileDescriptor_8ed77f46b627050b, []int{4}
return fileDescriptor_35f7661c22f951dd, []int{4}
}
func (m *Ballot) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -289,55 +289,55 @@ func (m *Ballot) GetContent() []byte {
}
func init() {
proto.RegisterType((*Params)(nil), "zgc.committee.v1.Params")
proto.RegisterType((*GenesisState)(nil), "zgc.committee.v1.GenesisState")
proto.RegisterType((*Committee)(nil), "zgc.committee.v1.Committee")
proto.RegisterType((*Vote)(nil), "zgc.committee.v1.Vote")
proto.RegisterType((*Ballot)(nil), "zgc.committee.v1.Ballot")
proto.RegisterType((*Params)(nil), "zgc.council.v1.Params")
proto.RegisterType((*GenesisState)(nil), "zgc.council.v1.GenesisState")
proto.RegisterType((*Council)(nil), "zgc.council.v1.Council")
proto.RegisterType((*Vote)(nil), "zgc.council.v1.Vote")
proto.RegisterType((*Ballot)(nil), "zgc.council.v1.Ballot")
}
func init() { proto.RegisterFile("zgc/committee/v1/genesis.proto", fileDescriptor_8ed77f46b627050b) }
func init() { proto.RegisterFile("zgc/council/v1/genesis.proto", fileDescriptor_35f7661c22f951dd) }
var fileDescriptor_8ed77f46b627050b = []byte{
// 596 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x4d, 0x6e, 0xd3, 0x40,
0x14, 0xc7, 0x63, 0x27, 0x75, 0xd5, 0x89, 0xcb, 0xc7, 0xb4, 0xaa, 0xdc, 0x22, 0xec, 0x12, 0x84,
0x94, 0x4d, 0xec, 0x36, 0x48, 0x2c, 0xba, 0xab, 0x5b, 0x89, 0x64, 0x57, 0x39, 0x52, 0x17, 0x2c,
0x88, 0xfc, 0x31, 0x4c, 0x46, 0xc4, 0x9e, 0xc8, 0x33, 0x89, 0x48, 0x4e, 0xc0, 0x92, 0x23, 0x70,
0x01, 0x58, 0x71, 0x88, 0x2e, 0x2b, 0xc4, 0x82, 0x55, 0x84, 0x9c, 0x5b, 0xb0, 0x42, 0x99, 0xb1,
0x4d, 0x92, 0xc2, 0x02, 0x89, 0x95, 0x3d, 0xef, 0xff, 0x9b, 0x37, 0xf3, 0x7f, 0xef, 0xd9, 0xc0,
0x9c, 0xe1, 0xd0, 0x09, 0x69, 0x1c,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 0x16, 0xed, 0x7e, 0x36, 0xb7, 0xea, 0xab, 0xcd, 0xab, 0x87,
0x2b, 0x5d, 0x7b, 0x2d, 0x4d, 0xa5, 0xa2, 0x70, 0xff, 0xf3, 0x7a, 0x32, 0x2d, 0x6c, 0x83, 0xed,
0xc0, 0x1f, 0x0e, 0x29, 0x67, 0x46, 0x55, 0x94, 0xed, 0x0f, 0xd3, 0xee, 0x0a, 0xc0, 0x2b, 0xc0,
0x7c, 0x0c, 0xce, 0x80, 0x26, 0x85, 0xbf, 0x8e, 0x80, 0x01, 0xb6, 0x43, 0x9a, 0x70, 0x94, 0xc8,
0xb6, 0xeb, 0x5e, 0xb1, 0x74, 0xbb, 0x37, 0x99, 0xa9, 0xdc, 0x66, 0xa6, 0xf2, 0x23, 0x33, 0x95,
0x0f, 0x0b, 0xb3, 0x72, 0xbb, 0x30, 0x2b, 0xdf, 0x17, 0x66, 0xe5, 0x95, 0xb3, 0x62, 0xee, 0x04,
0x0f, 0xfd, 0x80, 0x39, 0x27, 0xb8, 0x15, 0x0e, 0x7c, 0x92, 0x38, 0xef, 0xd6, 0x7f, 0x3b, 0xc2,
0x69, 0xa0, 0x89, 0xcf, 0xfe, 0xf9, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfc, 0x35, 0x1d, 0xae,
0x97, 0x04, 0x00, 0x00,
var fileDescriptor_35f7661c22f951dd = []byte{
// 594 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x3f, 0x6f, 0xd3, 0x4e,
0x1c, 0xc6, 0x63, 0x27, 0x75, 0x7e, 0xbd, 0xb8, 0x3f, 0x95, 0x6b, 0x55, 0xdc, 0x0a, 0xec, 0x36,
0x2c, 0x95, 0x20, 0x76, 0x5a, 0x58, 0xe8, 0x86, 0x5b, 0xa9, 0xed, 0x56, 0xb9, 0x52, 0x07, 0x06,
0x22, 0xff, 0x39, 0x2e, 0x27, 0x6c, 0x5f, 0xe4, 0xbb, 0x44, 0x34, 0xaf, 0x80, 0x91, 0x57, 0x80,
0x58, 0xd9, 0x79, 0x11, 0x1d, 0x18, 0x2a, 0x26, 0xa6, 0x08, 0x39, 0xef, 0x82, 0x09, 0xe5, 0xee,
0x5c, 0x92, 0x20, 0x06, 0x24, 0x26, 0xfb, 0x9e, 0xe7, 0x73, 0x7f, 0x9e, 0xef, 0xf7, 0x6c, 0xf0,
0x60, 0x8c, 0x63, 0x2f, 0xa6, 0xc3, 0x3c, 0x26, 0xa9, 0x37, 0x3a, 0xf0, 0x30, 0xca, 0x11, 0x23,
0xcc, 0x1d, 0x14, 0x94, 0x53, 0xf8, 0xff, 0x18, 0xc7, 0xae, 0x72, 0xdd, 0xd1, 0xc1, 0xce, 0x76,
0x4c, 0x59, 0x46, 0x59, 0x4f, 0xb8, 0x9e, 0x1c, 0x48, 0x74, 0x67, 0x13, 0x53, 0x4c, 0xa5, 0x3e,
0x7b, 0x53, 0xea, 0x36, 0xa6, 0x14, 0xa7, 0xc8, 0x13, 0xa3, 0x68, 0xf8, 0xda, 0x0b, 0xf3, 0x6b,
0x65, 0x39, 0xcb, 0x16, 0x27, 0x19, 0x62, 0x3c, 0xcc, 0x06, 0x12, 0x68, 0x3f, 0x06, 0xc6, 0x45,
0x58, 0x84, 0x19, 0x83, 0x7b, 0xc0, 0x54, 0x87, 0xe8, 0x31, 0x32, 0x46, 0x96, 0xb6, 0xab, 0xed,
0x37, 0x82, 0x96, 0xd2, 0x2e, 0xc9, 0x18, 0xb5, 0x3f, 0xe8, 0xc0, 0x3c, 0x95, 0x67, 0xbf, 0xe4,
0x21, 0x47, 0xf0, 0x19, 0x30, 0x06, 0x62, 0xb6, 0xa0, 0x5b, 0x87, 0x5b, 0xee, 0x62, 0x16, 0x57,
0xae, 0xed, 0x37, 0x6e, 0x26, 0x4e, 0x2d, 0x50, 0x2c, 0x74, 0xc1, 0xc6, 0x88, 0x72, 0x92, 0xe3,
0x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x47, 0x87, 0x25, 0x6f, 0x3c, 0x7e,
0x3d, 0x40, 0xcc, 0xbd, 0x0a, 0xd3, 0x17, 0x49, 0x52, 0x20, 0xc6, 0xbe, 0x7e, 0xee, 0x6c, 0xa8,
0xbb, 0xab, 0x14, 0xff, 0x9a, 0x23, 0x16, 0x54, 0x0b, 0xb7, 0xbf, 0x68, 0xa0, 0x31, 0xdb, 0x19,
0x3e, 0x01, 0x60, 0xae, 0x63, 0xb2, 0x60, 0x6b, 0xe5, 0xc4, 0x59, 0xfd, 0xd5, 0xaa, 0xd5, 0xf8,
0xae, 0x47, 0xaf, 0x64, 0x98, 0x42, 0x14, 0xec, 0x5f, 0x1e, 0x4c, 0x2e, 0x0b, 0xbb, 0xa0, 0x19,
0x85, 0x69, 0x4a, 0x39, 0xb3, 0xea, 0xa2, 0x5c, 0xbf, 0xdd, 0x69, 0x5f, 0xd8, 0x41, 0x85, 0xa9,
0xd6, 0x1f, 0x01, 0x43, 0x1a, 0x7f, 0x6c, 0xbc, 0x05, 0x9a, 0x31, 0xcd, 0x39, 0xca, 0x65, 0xb3,
0xcd, 0xa0, 0x1a, 0xfa, 0xa7, 0x37, 0xa5, 0xad, 0xdd, 0x96, 0xb6, 0xf6, 0xbd, 0xb4, 0xb5, 0xf7,
0x53, 0xbb, 0x76, 0x3b, 0xb5, 0x6b, 0xdf, 0xa6, 0x76, 0xed, 0xe5, 0x7c, 0xb4, 0x2e, 0x4e, 0xc3,
0x88, 0x79, 0x5d, 0xdc, 0x89, 0xfb, 0x21, 0xc9, 0xbd, 0xb7, 0xf3, 0xbf, 0x14, 0x91, 0x32, 0x32,
0xc4, 0x47, 0xfd, 0xf4, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x57, 0x4d, 0xc7, 0xe0, 0x71, 0x04,
0x00, 0x00,
}
func (m *Params) Marshal() (dAtA []byte, err error) {
@ -360,8 +360,8 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
if m.CommitteeSize != 0 {
i = encodeVarintGenesis(dAtA, i, uint64(m.CommitteeSize))
if m.CouncilSize != 0 {
i = encodeVarintGenesis(dAtA, i, uint64(m.CouncilSize))
i--
dAtA[i] = 0x8
}
@ -388,10 +388,10 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
if len(m.Committees) > 0 {
for iNdEx := len(m.Committees) - 1; iNdEx >= 0; iNdEx-- {
if len(m.Councils) > 0 {
for iNdEx := len(m.Councils) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.Committees[iNdEx].MarshalToSizedBuffer(dAtA[:i])
size, err := m.Councils[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
@ -402,8 +402,8 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
dAtA[i] = 0x2a
}
}
if m.CurrentCommitteeID != 0 {
i = encodeVarintGenesis(dAtA, i, uint64(m.CurrentCommitteeID))
if m.CurrentCouncilID != 0 {
i = encodeVarintGenesis(dAtA, i, uint64(m.CurrentCouncilID))
i--
dAtA[i] = 0x20
}
@ -430,7 +430,7 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
func (m *Committee) Marshal() (dAtA []byte, err error) {
func (m *Council) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@ -440,12 +440,12 @@ func (m *Committee) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
func (m *Committee) MarshalTo(dAtA []byte) (int, error) {
func (m *Council) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Committee) MarshalToSizedBuffer(dAtA []byte) (int, error) {
func (m *Council) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
@ -537,8 +537,8 @@ func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i--
dAtA[i] = 0x12
}
if m.CommitteeID != 0 {
i = encodeVarintGenesis(dAtA, i, uint64(m.CommitteeID))
if m.CouncilID != 0 {
i = encodeVarintGenesis(dAtA, i, uint64(m.CouncilID))
i--
dAtA[i] = 0x8
}
@ -597,8 +597,8 @@ func (m *Params) Size() (n int) {
}
var l int
_ = l
if m.CommitteeSize != 0 {
n += 1 + sovGenesis(uint64(m.CommitteeSize))
if m.CouncilSize != 0 {
n += 1 + sovGenesis(uint64(m.CouncilSize))
}
return n
}
@ -617,11 +617,11 @@ func (m *GenesisState) Size() (n int) {
if m.VotingPeriod != 0 {
n += 1 + sovGenesis(uint64(m.VotingPeriod))
}
if m.CurrentCommitteeID != 0 {
n += 1 + sovGenesis(uint64(m.CurrentCommitteeID))
if m.CurrentCouncilID != 0 {
n += 1 + sovGenesis(uint64(m.CurrentCouncilID))
}
if len(m.Committees) > 0 {
for _, e := range m.Committees {
if len(m.Councils) > 0 {
for _, e := range m.Councils {
l = e.Size()
n += 1 + l + sovGenesis(uint64(l))
}
@ -629,7 +629,7 @@ func (m *GenesisState) Size() (n int) {
return n
}
func (m *Committee) Size() (n int) {
func (m *Council) Size() (n int) {
if m == nil {
return 0
}
@ -668,8 +668,8 @@ func (m *Vote) Size() (n int) {
}
var l int
_ = l
if m.CommitteeID != 0 {
n += 1 + sovGenesis(uint64(m.CommitteeID))
if m.CouncilID != 0 {
n += 1 + sovGenesis(uint64(m.CouncilID))
}
l = len(m.Voter)
if l > 0 {
@ -737,9 +737,9 @@ func (m *Params) Unmarshal(dAtA []byte) error {
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field CommitteeSize", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field CouncilSize", wireType)
}
m.CommitteeSize = 0
m.CouncilSize = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
@ -749,7 +749,7 @@ func (m *Params) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
m.CommitteeSize |= uint64(b&0x7F) << shift
m.CouncilSize |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
@ -877,9 +877,9 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error {
}
case 4:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field CurrentCommitteeID", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field CurrentCouncilID", wireType)
}
m.CurrentCommitteeID = 0
m.CurrentCouncilID = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
@ -889,14 +889,14 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
m.CurrentCommitteeID |= uint64(b&0x7F) << shift
m.CurrentCouncilID |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Committees", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field Councils", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@ -923,8 +923,8 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Committees = append(m.Committees, Committee{})
if err := m.Committees[len(m.Committees)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
m.Councils = append(m.Councils, Council{})
if err := m.Councils[len(m.Councils)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@ -949,7 +949,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error {
}
return nil
}
func (m *Committee) Unmarshal(dAtA []byte) error {
func (m *Council) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@ -972,10 +972,10 @@ func (m *Committee) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Committee: wiretype end group for non-group")
return fmt.Errorf("proto: Council: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Committee: illegal tag %d (wire type %d)", fieldNum, wire)
return fmt.Errorf("proto: Council: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
@ -1172,9 +1172,9 @@ func (m *Vote) Unmarshal(dAtA []byte) error {
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field CommitteeID", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field CouncilID", wireType)
}
m.CommitteeID = 0
m.CouncilID = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
@ -1184,7 +1184,7 @@ func (m *Vote) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
m.CommitteeID |= uint64(b&0x7F) << shift
m.CouncilID |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}

View File

@ -8,7 +8,7 @@ import (
const (
// ModuleName The name that will be used throughout the module
ModuleName = "committee"
ModuleName = "council"
// StoreKey Top level store key where all module items will be stored
StoreKey = ModuleName
@ -16,14 +16,14 @@ const (
// Key prefixes
var (
CommitteeKeyPrefix = []byte{0x00} // prefix for keys that store committees
CouncilKeyPrefix = []byte{0x00} // prefix for keys that store councils
VoteKeyPrefix = []byte{0x01} // prefix for keys that store votes
VoterKeyPrefix = []byte{0x02} // prefix for keys that store voters
ParamsKey = []byte{0x03}
VotingStartHeightKey = []byte{0x04}
VotingPeriodKey = []byte{0x05}
CurrentCommitteeIDKey = []byte{0x06}
CurrentCouncilIDKey = []byte{0x06}
)
// GetKeyFromID returns the bytes to use as a key for a uint64 id
@ -31,8 +31,8 @@ func GetKeyFromID(id uint64) []byte {
return Uint64ToBytes(id)
}
func GetVoteKey(committeeID uint64, voter sdk.ValAddress) []byte {
return append(GetKeyFromID(committeeID), voter.Bytes()...)
func GetVoteKey(councilID uint64, voter sdk.ValAddress) []byte {
return append(GetKeyFromID(councilID), voter.Bytes()...)
}
func GetVoterKey(voter sdk.ValAddress) []byte {

View File

@ -1,5 +1,5 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: zgc/committee/v1/query.proto
// source: zgc/council/v1/query.proto
package types
@ -32,21 +32,21 @@ var _ = math.Inf
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type QueryCurrentCommitteeIDRequest struct {
type QueryCurrentCouncilIDRequest struct {
}
func (m *QueryCurrentCommitteeIDRequest) Reset() { *m = QueryCurrentCommitteeIDRequest{} }
func (m *QueryCurrentCommitteeIDRequest) String() string { return proto.CompactTextString(m) }
func (*QueryCurrentCommitteeIDRequest) ProtoMessage() {}
func (*QueryCurrentCommitteeIDRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_e1eb280fe137a977, []int{0}
func (m *QueryCurrentCouncilIDRequest) Reset() { *m = QueryCurrentCouncilIDRequest{} }
func (m *QueryCurrentCouncilIDRequest) String() string { return proto.CompactTextString(m) }
func (*QueryCurrentCouncilIDRequest) ProtoMessage() {}
func (*QueryCurrentCouncilIDRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_eb373abb48fc6ce6, []int{0}
}
func (m *QueryCurrentCommitteeIDRequest) XXX_Unmarshal(b []byte) error {
func (m *QueryCurrentCouncilIDRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *QueryCurrentCommitteeIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
func (m *QueryCurrentCouncilIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryCurrentCommitteeIDRequest.Marshal(b, m, deterministic)
return xxx_messageInfo_QueryCurrentCouncilIDRequest.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
@ -56,34 +56,34 @@ func (m *QueryCurrentCommitteeIDRequest) XXX_Marshal(b []byte, deterministic boo
return b[:n], nil
}
}
func (m *QueryCurrentCommitteeIDRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryCurrentCommitteeIDRequest.Merge(m, src)
func (m *QueryCurrentCouncilIDRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryCurrentCouncilIDRequest.Merge(m, src)
}
func (m *QueryCurrentCommitteeIDRequest) XXX_Size() int {
func (m *QueryCurrentCouncilIDRequest) XXX_Size() int {
return m.Size()
}
func (m *QueryCurrentCommitteeIDRequest) XXX_DiscardUnknown() {
xxx_messageInfo_QueryCurrentCommitteeIDRequest.DiscardUnknown(m)
func (m *QueryCurrentCouncilIDRequest) XXX_DiscardUnknown() {
xxx_messageInfo_QueryCurrentCouncilIDRequest.DiscardUnknown(m)
}
var xxx_messageInfo_QueryCurrentCommitteeIDRequest proto.InternalMessageInfo
var xxx_messageInfo_QueryCurrentCouncilIDRequest proto.InternalMessageInfo
type QueryCurrentCommitteeIDResponse struct {
CurrentCommitteeID uint64 `protobuf:"varint,1,opt,name=current_committee_id,json=currentCommitteeId,proto3" json:"current_committee_id,omitempty"`
type QueryCurrentCouncilIDResponse struct {
CurrentCouncilID uint64 `protobuf:"varint,1,opt,name=current_council_id,json=currentCouncilId,proto3" json:"current_council_id,omitempty"`
}
func (m *QueryCurrentCommitteeIDResponse) Reset() { *m = QueryCurrentCommitteeIDResponse{} }
func (m *QueryCurrentCommitteeIDResponse) String() string { return proto.CompactTextString(m) }
func (*QueryCurrentCommitteeIDResponse) ProtoMessage() {}
func (*QueryCurrentCommitteeIDResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_e1eb280fe137a977, []int{1}
func (m *QueryCurrentCouncilIDResponse) Reset() { *m = QueryCurrentCouncilIDResponse{} }
func (m *QueryCurrentCouncilIDResponse) String() string { return proto.CompactTextString(m) }
func (*QueryCurrentCouncilIDResponse) ProtoMessage() {}
func (*QueryCurrentCouncilIDResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_eb373abb48fc6ce6, []int{1}
}
func (m *QueryCurrentCommitteeIDResponse) XXX_Unmarshal(b []byte) error {
func (m *QueryCurrentCouncilIDResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *QueryCurrentCommitteeIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
func (m *QueryCurrentCouncilIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryCurrentCommitteeIDResponse.Marshal(b, m, deterministic)
return xxx_messageInfo_QueryCurrentCouncilIDResponse.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
@ -93,17 +93,17 @@ func (m *QueryCurrentCommitteeIDResponse) XXX_Marshal(b []byte, deterministic bo
return b[:n], nil
}
}
func (m *QueryCurrentCommitteeIDResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryCurrentCommitteeIDResponse.Merge(m, src)
func (m *QueryCurrentCouncilIDResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryCurrentCouncilIDResponse.Merge(m, src)
}
func (m *QueryCurrentCommitteeIDResponse) XXX_Size() int {
func (m *QueryCurrentCouncilIDResponse) XXX_Size() int {
return m.Size()
}
func (m *QueryCurrentCommitteeIDResponse) XXX_DiscardUnknown() {
xxx_messageInfo_QueryCurrentCommitteeIDResponse.DiscardUnknown(m)
func (m *QueryCurrentCouncilIDResponse) XXX_DiscardUnknown() {
xxx_messageInfo_QueryCurrentCouncilIDResponse.DiscardUnknown(m)
}
var xxx_messageInfo_QueryCurrentCommitteeIDResponse proto.InternalMessageInfo
var xxx_messageInfo_QueryCurrentCouncilIDResponse proto.InternalMessageInfo
type QueryRegisteredVotersRequest struct {
}
@ -112,7 +112,7 @@ func (m *QueryRegisteredVotersRequest) Reset() { *m = QueryRegisteredVot
func (m *QueryRegisteredVotersRequest) String() string { return proto.CompactTextString(m) }
func (*QueryRegisteredVotersRequest) ProtoMessage() {}
func (*QueryRegisteredVotersRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_e1eb280fe137a977, []int{2}
return fileDescriptor_eb373abb48fc6ce6, []int{2}
}
func (m *QueryRegisteredVotersRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -149,7 +149,7 @@ func (m *QueryRegisteredVotersResponse) Reset() { *m = QueryRegisteredVo
func (m *QueryRegisteredVotersResponse) String() string { return proto.CompactTextString(m) }
func (*QueryRegisteredVotersResponse) ProtoMessage() {}
func (*QueryRegisteredVotersResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_e1eb280fe137a977, []int{3}
return fileDescriptor_eb373abb48fc6ce6, []int{3}
}
func (m *QueryRegisteredVotersResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -179,43 +179,43 @@ func (m *QueryRegisteredVotersResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_QueryRegisteredVotersResponse proto.InternalMessageInfo
func init() {
proto.RegisterType((*QueryCurrentCommitteeIDRequest)(nil), "zgc.committee.v1.QueryCurrentCommitteeIDRequest")
proto.RegisterType((*QueryCurrentCommitteeIDResponse)(nil), "zgc.committee.v1.QueryCurrentCommitteeIDResponse")
proto.RegisterType((*QueryRegisteredVotersRequest)(nil), "zgc.committee.v1.QueryRegisteredVotersRequest")
proto.RegisterType((*QueryRegisteredVotersResponse)(nil), "zgc.committee.v1.QueryRegisteredVotersResponse")
proto.RegisterType((*QueryCurrentCouncilIDRequest)(nil), "zgc.council.v1.QueryCurrentCouncilIDRequest")
proto.RegisterType((*QueryCurrentCouncilIDResponse)(nil), "zgc.council.v1.QueryCurrentCouncilIDResponse")
proto.RegisterType((*QueryRegisteredVotersRequest)(nil), "zgc.council.v1.QueryRegisteredVotersRequest")
proto.RegisterType((*QueryRegisteredVotersResponse)(nil), "zgc.council.v1.QueryRegisteredVotersResponse")
}
func init() { proto.RegisterFile("zgc/committee/v1/query.proto", fileDescriptor_e1eb280fe137a977) }
func init() { proto.RegisterFile("zgc/council/v1/query.proto", fileDescriptor_eb373abb48fc6ce6) }
var fileDescriptor_e1eb280fe137a977 = []byte{
// 425 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0x3f, 0x6f, 0xd3, 0x40,
0x14, 0xf7, 0x15, 0xa8, 0xc4, 0x4d, 0xd5, 0xa9, 0xaa, 0x5a, 0x2b, 0x5c, 0x22, 0x2f, 0x14, 0x84,
0x7d, 0x4e, 0x19, 0xd8, 0x5b, 0x06, 0x18, 0x18, 0xc8, 0xc0, 0xc0, 0x12, 0xf9, 0xcf, 0xe3, 0x7a,
0xa2, 0xbe, 0x73, 0x7d, 0xe7, 0x88, 0x76, 0xe4, 0x13, 0x20, 0xf1, 0x15, 0x58, 0xf9, 0x1e, 0x19,
0x23, 0xb1, 0x30, 0x45, 0xe0, 0xf0, 0x41, 0x50, 0xec, 0x8b, 0xa5, 0x98, 0x18, 0xc1, 0xe6, 0xf7,
0xfb, 0xf3, 0xde, 0xef, 0xde, 0x33, 0x1e, 0xdc, 0xf2, 0x84, 0x25, 0x2a, 0xcb, 0x84, 0x31, 0x00,
0x6c, 0x36, 0x66, 0xd7, 0x25, 0x14, 0x37, 0x41, 0x5e, 0x28, 0xa3, 0xc8, 0xc1, 0x2d, 0x4f, 0x82,
0x96, 0x0d, 0x66, 0x63, 0xf7, 0x24, 0x51, 0x3a, 0x53, 0x7a, 0x5a, 0xf3, 0xac, 0x29, 0x1a, 0xb1,
0x7b, 0xc8, 0x15, 0x57, 0x0d, 0xbe, 0xfe, 0xb2, 0xe8, 0x80, 0x2b, 0xc5, 0xaf, 0x80, 0x45, 0xb9,
0x60, 0x91, 0x94, 0xca, 0x44, 0x46, 0x28, 0xb9, 0xf1, 0x9c, 0x58, 0xb6, 0xae, 0xe2, 0xf2, 0x1d,
0x8b, 0xa4, 0x9d, 0xed, 0x0e, 0xbb, 0x94, 0x11, 0x19, 0x68, 0x13, 0x65, 0xb9, 0x15, 0x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0x6a, 0xfe, 0x93, 0x3a, 0xf3, 0x8a, 0xa2, 0x45, 0x45, 0xd1,
0x8f, 0x8a, 0xa2, 0x4f, 0x2b, 0xea, 0x2c, 0x56, 0xd4, 0xf9, 0xbe, 0xa2, 0xce, 0x5b, 0xc6, 0x85,
0xb9, 0x2c, 0xe3, 0x75, 0x02, 0x16, 0xf2, 0xab, 0x28, 0xd6, 0x2c, 0xe4, 0x7e, 0xd3, 0xf8, 0xc3,
0x76, 0x6b, 0x73, 0x93, 0x83, 0x8e, 0xf7, 0xeb, 0xdf, 0xf3, 0xe9, 0xef, 0x00, 0x00, 0x00, 0xff,
0xff, 0xbc, 0x1f, 0xba, 0xac, 0x7b, 0x03, 0x00, 0x00,
var fileDescriptor_eb373abb48fc6ce6 = []byte{
// 418 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x3f, 0x8f, 0xd3, 0x30,
0x18, 0xc6, 0xe3, 0x03, 0x4e, 0xc2, 0x03, 0xaa, 0xac, 0x13, 0xba, 0x8b, 0x0e, 0x5f, 0x15, 0x09,
0xe8, 0x40, 0xe2, 0x16, 0x06, 0xf6, 0x96, 0x05, 0x31, 0xd1, 0x81, 0x81, 0xa5, 0x4a, 0x1c, 0xe3,
0x5a, 0x6a, 0xec, 0x34, 0x76, 0x2a, 0xda, 0x91, 0x4f, 0x80, 0xc4, 0x0e, 0x5f, 0xa7, 0x62, 0xaa,
0xc4, 0xc2, 0x84, 0x20, 0xe5, 0x83, 0xa0, 0xc6, 0x6e, 0xd5, 0x3f, 0x04, 0xb1, 0xe5, 0x7d, 0x9e,
0xf7, 0x7d, 0xfd, 0xf3, 0xe3, 0x40, 0x7f, 0xc1, 0x29, 0xa1, 0xaa, 0x94, 0x54, 0x4c, 0xc8, 0xac,
0x47, 0xa6, 0x25, 0x2b, 0xe6, 0x51, 0x5e, 0x28, 0xa3, 0xd0, 0xbd, 0x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0x2b, 0x0a, 0x3f, 0xfc, 0xcf, 0x6e, 0xcb, 0x14, 0x44, 0x1f, 0xbe, 0xfd, 0xfe, 0x74, 0xd6,
0x41, 0x8f, 0x48, 0x97, 0xd3, 0x71, 0x2c, 0xe4, 0xfe, 0x23, 0xb8, 0x08, 0x42, 0x27, 0x85, 0x22,
0x45, 0x9f, 0x01, 0x6c, 0x1d, 0x5f, 0xb0, 0x81, 0xb0, 0x21, 0xa7, 0x06, 0xc2, 0xa6, 0xd4, 0x82,
0xb0, 0x26, 0x7c, 0x8c, 0x1e, 0xfe, 0x8d, 0xb0, 0xd8, 0x4d, 0x85, 0x36, 0xcc, 0xfe, 0xab, 0xe5,
0x2f, 0xec, 0x2d, 0x2b, 0x0c, 0x56, 0x15, 0x06, 0x3f, 0x2b, 0x0c, 0x3e, 0xae, 0xb1, 0xb7, 0x5a,
0x63, 0xef, 0xfb, 0x1a, 0x7b, 0x6f, 0x43, 0x2e, 0xcc, 0xb8, 0x4c, 0x22, 0xaa, 0x32, 0xd2, 0xe5,
0x93, 0x38, 0xd1, 0xa4, 0xcb, 0x43, 0xbb, 0xf6, 0xfd, 0xfe, 0x62, 0x33, 0xcf, 0x99, 0x4e, 0xce,
0xeb, 0xdf, 0xef, 0xd9, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6f, 0x29, 0x40, 0xb9, 0x55, 0x03,
0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@ -230,7 +230,7 @@ const _ = grpc.SupportPackageIsVersion4
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type QueryClient interface {
CurrentCommitteeID(ctx context.Context, in *QueryCurrentCommitteeIDRequest, opts ...grpc.CallOption) (*QueryCurrentCommitteeIDResponse, error)
CurrentCouncilID(ctx context.Context, in *QueryCurrentCouncilIDRequest, opts ...grpc.CallOption) (*QueryCurrentCouncilIDResponse, error)
RegisteredVoters(ctx context.Context, in *QueryRegisteredVotersRequest, opts ...grpc.CallOption) (*QueryRegisteredVotersResponse, error)
}
@ -242,9 +242,9 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient {
return &queryClient{cc}
}
func (c *queryClient) CurrentCommitteeID(ctx context.Context, in *QueryCurrentCommitteeIDRequest, opts ...grpc.CallOption) (*QueryCurrentCommitteeIDResponse, error) {
out := new(QueryCurrentCommitteeIDResponse)
err := c.cc.Invoke(ctx, "/zgc.committee.v1.Query/CurrentCommitteeID", in, out, opts...)
func (c *queryClient) CurrentCouncilID(ctx context.Context, in *QueryCurrentCouncilIDRequest, opts ...grpc.CallOption) (*QueryCurrentCouncilIDResponse, error) {
out := new(QueryCurrentCouncilIDResponse)
err := c.cc.Invoke(ctx, "/zgc.council.v1.Query/CurrentCouncilID", in, out, opts...)
if err != nil {
return nil, err
}
@ -253,7 +253,7 @@ func (c *queryClient) CurrentCommitteeID(ctx context.Context, in *QueryCurrentCo
func (c *queryClient) RegisteredVoters(ctx context.Context, in *QueryRegisteredVotersRequest, opts ...grpc.CallOption) (*QueryRegisteredVotersResponse, error) {
out := new(QueryRegisteredVotersResponse)
err := c.cc.Invoke(ctx, "/zgc.committee.v1.Query/RegisteredVoters", in, out, opts...)
err := c.cc.Invoke(ctx, "/zgc.council.v1.Query/RegisteredVoters", in, out, opts...)
if err != nil {
return nil, err
}
@ -262,7 +262,7 @@ func (c *queryClient) RegisteredVoters(ctx context.Context, in *QueryRegisteredV
// QueryServer is the server API for Query service.
type QueryServer interface {
CurrentCommitteeID(context.Context, *QueryCurrentCommitteeIDRequest) (*QueryCurrentCommitteeIDResponse, error)
CurrentCouncilID(context.Context, *QueryCurrentCouncilIDRequest) (*QueryCurrentCouncilIDResponse, error)
RegisteredVoters(context.Context, *QueryRegisteredVotersRequest) (*QueryRegisteredVotersResponse, error)
}
@ -270,8 +270,8 @@ type QueryServer interface {
type UnimplementedQueryServer struct {
}
func (*UnimplementedQueryServer) CurrentCommitteeID(ctx context.Context, req *QueryCurrentCommitteeIDRequest) (*QueryCurrentCommitteeIDResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CurrentCommitteeID not implemented")
func (*UnimplementedQueryServer) CurrentCouncilID(ctx context.Context, req *QueryCurrentCouncilIDRequest) (*QueryCurrentCouncilIDResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CurrentCouncilID not implemented")
}
func (*UnimplementedQueryServer) RegisteredVoters(ctx context.Context, req *QueryRegisteredVotersRequest) (*QueryRegisteredVotersResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RegisteredVoters not implemented")
@ -281,20 +281,20 @@ func RegisterQueryServer(s grpc1.Server, srv QueryServer) {
s.RegisterService(&_Query_serviceDesc, srv)
}
func _Query_CurrentCommitteeID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryCurrentCommitteeIDRequest)
func _Query_CurrentCouncilID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryCurrentCouncilIDRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).CurrentCommitteeID(ctx, in)
return srv.(QueryServer).CurrentCouncilID(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/zgc.committee.v1.Query/CurrentCommitteeID",
FullMethod: "/zgc.council.v1.Query/CurrentCouncilID",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).CurrentCommitteeID(ctx, req.(*QueryCurrentCommitteeIDRequest))
return srv.(QueryServer).CurrentCouncilID(ctx, req.(*QueryCurrentCouncilIDRequest))
}
return interceptor(ctx, in, info, handler)
}
@ -309,7 +309,7 @@ func _Query_RegisteredVoters_Handler(srv interface{}, ctx context.Context, dec f
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/zgc.committee.v1.Query/RegisteredVoters",
FullMethod: "/zgc.council.v1.Query/RegisteredVoters",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).RegisteredVoters(ctx, req.(*QueryRegisteredVotersRequest))
@ -318,12 +318,12 @@ func _Query_RegisteredVoters_Handler(srv interface{}, ctx context.Context, dec f
}
var _Query_serviceDesc = grpc.ServiceDesc{
ServiceName: "zgc.committee.v1.Query",
ServiceName: "zgc.council.v1.Query",
HandlerType: (*QueryServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CurrentCommitteeID",
Handler: _Query_CurrentCommitteeID_Handler,
MethodName: "CurrentCouncilID",
Handler: _Query_CurrentCouncilID_Handler,
},
{
MethodName: "RegisteredVoters",
@ -331,10 +331,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "zgc/committee/v1/query.proto",
Metadata: "zgc/council/v1/query.proto",
}
func (m *QueryCurrentCommitteeIDRequest) Marshal() (dAtA []byte, err error) {
func (m *QueryCurrentCouncilIDRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@ -344,12 +344,12 @@ func (m *QueryCurrentCommitteeIDRequest) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
func (m *QueryCurrentCommitteeIDRequest) MarshalTo(dAtA []byte) (int, error) {
func (m *QueryCurrentCouncilIDRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *QueryCurrentCommitteeIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
func (m *QueryCurrentCouncilIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
@ -357,7 +357,7 @@ func (m *QueryCurrentCommitteeIDRequest) MarshalToSizedBuffer(dAtA []byte) (int,
return len(dAtA) - i, nil
}
func (m *QueryCurrentCommitteeIDResponse) Marshal() (dAtA []byte, err error) {
func (m *QueryCurrentCouncilIDResponse) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
@ -367,18 +367,18 @@ func (m *QueryCurrentCommitteeIDResponse) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil
}
func (m *QueryCurrentCommitteeIDResponse) MarshalTo(dAtA []byte) (int, error) {
func (m *QueryCurrentCouncilIDResponse) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *QueryCurrentCommitteeIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
func (m *QueryCurrentCouncilIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.CurrentCommitteeID != 0 {
i = encodeVarintQuery(dAtA, i, uint64(m.CurrentCommitteeID))
if m.CurrentCouncilID != 0 {
i = encodeVarintQuery(dAtA, i, uint64(m.CurrentCouncilID))
i--
dAtA[i] = 0x8
}
@ -451,7 +451,7 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
return base
}
func (m *QueryCurrentCommitteeIDRequest) Size() (n int) {
func (m *QueryCurrentCouncilIDRequest) Size() (n int) {
if m == nil {
return 0
}
@ -460,14 +460,14 @@ func (m *QueryCurrentCommitteeIDRequest) Size() (n int) {
return n
}
func (m *QueryCurrentCommitteeIDResponse) Size() (n int) {
func (m *QueryCurrentCouncilIDResponse) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.CurrentCommitteeID != 0 {
n += 1 + sovQuery(uint64(m.CurrentCommitteeID))
if m.CurrentCouncilID != 0 {
n += 1 + sovQuery(uint64(m.CurrentCouncilID))
}
return n
}
@ -502,7 +502,7 @@ func sovQuery(x uint64) (n int) {
func sozQuery(x uint64) (n int) {
return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *QueryCurrentCommitteeIDRequest) Unmarshal(dAtA []byte) error {
func (m *QueryCurrentCouncilIDRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@ -525,10 +525,10 @@ func (m *QueryCurrentCommitteeIDRequest) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: QueryCurrentCommitteeIDRequest: wiretype end group for non-group")
return fmt.Errorf("proto: QueryCurrentCouncilIDRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: QueryCurrentCommitteeIDRequest: illegal tag %d (wire type %d)", fieldNum, wire)
return fmt.Errorf("proto: QueryCurrentCouncilIDRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
default:
@ -552,7 +552,7 @@ func (m *QueryCurrentCommitteeIDRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
func (m *QueryCurrentCommitteeIDResponse) Unmarshal(dAtA []byte) error {
func (m *QueryCurrentCouncilIDResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@ -575,17 +575,17 @@ func (m *QueryCurrentCommitteeIDResponse) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: QueryCurrentCommitteeIDResponse: wiretype end group for non-group")
return fmt.Errorf("proto: QueryCurrentCouncilIDResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: QueryCurrentCommitteeIDResponse: illegal tag %d (wire type %d)", fieldNum, wire)
return fmt.Errorf("proto: QueryCurrentCouncilIDResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field CurrentCommitteeID", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field CurrentCouncilID", wireType)
}
m.CurrentCommitteeID = 0
m.CurrentCouncilID = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
@ -595,7 +595,7 @@ func (m *QueryCurrentCommitteeIDResponse) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
m.CurrentCommitteeID |= uint64(b&0x7F) << shift
m.CurrentCouncilID |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}

View File

@ -1,5 +1,5 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: zgc/committee/v1/query.proto
// source: zgc/council/v1/query.proto
/*
Package types is a reverse proxy.
@ -33,20 +33,20 @@ var _ = utilities.NewDoubleArray
var _ = descriptor.ForMessage
var _ = metadata.Join
func request_Query_CurrentCommitteeID_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryCurrentCommitteeIDRequest
func request_Query_CurrentCouncilID_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryCurrentCouncilIDRequest
var metadata runtime.ServerMetadata
msg, err := client.CurrentCommitteeID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
msg, err := client.CurrentCouncilID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Query_CurrentCommitteeID_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryCurrentCommitteeIDRequest
func local_request_Query_CurrentCouncilID_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryCurrentCouncilIDRequest
var metadata runtime.ServerMetadata
msg, err := server.CurrentCommitteeID(ctx, &protoReq)
msg, err := server.CurrentCouncilID(ctx, &protoReq)
return msg, metadata, err
}
@ -75,7 +75,7 @@ func local_request_Query_RegisteredVoters_0(ctx context.Context, marshaler runti
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error {
mux.Handle("GET", pattern_Query_CurrentCommitteeID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("GET", pattern_Query_CurrentCouncilID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
@ -86,7 +86,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Query_CurrentCommitteeID_0(rctx, inboundMarshaler, server, req, pathParams)
resp, md, err := local_request_Query_CurrentCouncilID_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
@ -94,7 +94,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
return
}
forward_Query_CurrentCommitteeID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_Query_CurrentCouncilID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
@ -162,7 +162,7 @@ func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc
// "QueryClient" to call the correct interceptors.
func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error {
mux.Handle("GET", pattern_Query_CurrentCommitteeID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("GET", pattern_Query_CurrentCouncilID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@ -171,14 +171,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Query_CurrentCommitteeID_0(rctx, inboundMarshaler, client, req, pathParams)
resp, md, err := request_Query_CurrentCouncilID_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Query_CurrentCommitteeID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_Query_CurrentCouncilID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
@ -206,13 +206,13 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
}
var (
pattern_Query_CurrentCommitteeID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"0gchain", "committee", "v1", "current-committee-id"}, "", runtime.AssumeColonVerbOpt(false)))
pattern_Query_CurrentCouncilID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"0gchain", "council", "v1", "current-council-id"}, "", runtime.AssumeColonVerbOpt(false)))
pattern_Query_RegisteredVoters_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"0gchain", "committee", "v1", "registered-voters"}, "", runtime.AssumeColonVerbOpt(false)))
pattern_Query_RegisteredVoters_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"0gchain", "council", "v1", "registered-voters"}, "", runtime.AssumeColonVerbOpt(false)))
)
var (
forward_Query_CurrentCommitteeID_0 = runtime.ForwardResponseMessage
forward_Query_CurrentCouncilID_0 = runtime.ForwardResponseMessage
forward_Query_RegisteredVoters_0 = runtime.ForwardResponseMessage
)

View File

@ -1,5 +1,5 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: zgc/committee/v1/tx.proto
// source: zgc/council/v1/tx.proto
package types
@ -39,7 +39,7 @@ func (m *MsgRegister) Reset() { *m = MsgRegister{} }
func (m *MsgRegister) String() string { return proto.CompactTextString(m) }
func (*MsgRegister) ProtoMessage() {}
func (*MsgRegister) Descriptor() ([]byte, []int) {
return fileDescriptor_ea97a64f78abecc0, []int{0}
return fileDescriptor_3783c1e1bc40f3a1, []int{0}
}
func (m *MsgRegister) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -75,7 +75,7 @@ func (m *MsgRegisterResponse) Reset() { *m = MsgRegisterResponse{} }
func (m *MsgRegisterResponse) String() string { return proto.CompactTextString(m) }
func (*MsgRegisterResponse) ProtoMessage() {}
func (*MsgRegisterResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_ea97a64f78abecc0, []int{1}
return fileDescriptor_3783c1e1bc40f3a1, []int{1}
}
func (m *MsgRegisterResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -105,7 +105,7 @@ func (m *MsgRegisterResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_MsgRegisterResponse proto.InternalMessageInfo
type MsgVote struct {
CommitteeID uint64 `protobuf:"varint,1,opt,name=committee_id,json=committeeId,proto3" json:"committee_id,omitempty"`
CouncilID uint64 `protobuf:"varint,1,opt,name=council_id,json=councilId,proto3" json:"council_id,omitempty"`
Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"`
Ballots []*Ballot `protobuf:"bytes,3,rep,name=ballots,proto3" json:"ballots,omitempty"`
}
@ -114,7 +114,7 @@ func (m *MsgVote) Reset() { *m = MsgVote{} }
func (m *MsgVote) String() string { return proto.CompactTextString(m) }
func (*MsgVote) ProtoMessage() {}
func (*MsgVote) Descriptor() ([]byte, []int) {
return fileDescriptor_ea97a64f78abecc0, []int{2}
return fileDescriptor_3783c1e1bc40f3a1, []int{2}
}
func (m *MsgVote) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -150,7 +150,7 @@ func (m *MsgVoteResponse) Reset() { *m = MsgVoteResponse{} }
func (m *MsgVoteResponse) String() string { return proto.CompactTextString(m) }
func (*MsgVoteResponse) ProtoMessage() {}
func (*MsgVoteResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_ea97a64f78abecc0, []int{3}
return fileDescriptor_3783c1e1bc40f3a1, []int{3}
}
func (m *MsgVoteResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -180,40 +180,40 @@ func (m *MsgVoteResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_MsgVoteResponse proto.InternalMessageInfo
func init() {
proto.RegisterType((*MsgRegister)(nil), "zgc.committee.v1.MsgRegister")
proto.RegisterType((*MsgRegisterResponse)(nil), "zgc.committee.v1.MsgRegisterResponse")
proto.RegisterType((*MsgVote)(nil), "zgc.committee.v1.MsgVote")
proto.RegisterType((*MsgVoteResponse)(nil), "zgc.committee.v1.MsgVoteResponse")
proto.RegisterType((*MsgRegister)(nil), "zgc.council.v1.MsgRegister")
proto.RegisterType((*MsgRegisterResponse)(nil), "zgc.council.v1.MsgRegisterResponse")
proto.RegisterType((*MsgVote)(nil), "zgc.council.v1.MsgVote")
proto.RegisterType((*MsgVoteResponse)(nil), "zgc.council.v1.MsgVoteResponse")
}
func init() { proto.RegisterFile("zgc/committee/v1/tx.proto", fileDescriptor_ea97a64f78abecc0) }
func init() { proto.RegisterFile("zgc/council/v1/tx.proto", fileDescriptor_3783c1e1bc40f3a1) }
var fileDescriptor_ea97a64f78abecc0 = []byte{
// 377 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0x4d, 0x8e, 0xda, 0x30,
0x18, 0x8d, 0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0x62, 0x5e, 0x01, 0xd8, 0x70, 0x38,
0xfd, 0xc3, 0x04, 0x51, 0x6d, 0xd8, 0xac, 0x7c, 0x27, 0xe1, 0x34, 0x53, 0xac, 0x0f, 0x5b, 0xc9,
0xdd, 0x17, 0xe5, 0x57, 0x39, 0x1f, 0x8f, 0x5c, 0xa5, 0x22, 0x8d, 0xa7, 0x4f, 0xf6, 0xb5, 0x53,
0x7b, 0x1b, 0x36, 0x7c, 0x2f, 0x8a, 0x98, 0xe0, 0x9a, 0xdc, 0x95, 0x7b, 0x8a, 0xad, 0x59, 0xe7,
0x77, 0x66, 0x0d, 0x33, 0x82, 0x5b, 0x12, 0xcd, 0x0f, 0xb0, 0x55, 0x2c, 0x52, 0x2e, 0x67, 0xdf,
0x00, 0x28, 0x3b, 0x9c, 0xaa, 0xbf, 0xe1, 0xbb, 0x2a, 0xef, 0xe7, 0x4b, 0xa5, 0x93, 0x5c, 0xc6,
0xb7, 0x57, 0xe1, 0x52, 0x59, 0x1d, 0xc1, 0x7a, 0x16, 0x59, 0x7f, 0x96, 0x9e, 0x42, 0xc6, 0xd7,
0x17, 0xa1, 0x52, 0x65, 0xe8, 0xec, 0x1f, 0x90, 0xb4, 0x4f, 0x10, 0x38, 0x24, 0x08, 0xdc, 0x27,
0x08, 0x5c, 0x1f, 0x91, 0x74, 0x38, 0x22, 0xe9, 0xf6, 0x88, 0xa4, 0xbf, 0x98, 0x86, 0x62, 0xb6,
0xf2, 0x53, 0x09, 0xdc, 0xa7, 0x91, 0xe7, 0x73, 0xdc, 0xa7, 0xdf, 0x83, 0x99, 0x17, 0xc6, 0x78,
0x73, 0xf6, 0xb5, 0xb6, 0x0b, 0xc2, 0xfd, 0xb7, 0xd9, 0x03, 0xff, 0x78, 0x0c, 0x00, 0x00, 0xff,
0xff, 0xec, 0xc0, 0x4c, 0xa8, 0x7b, 0x02, 0x00, 0x00,
var fileDescriptor_3783c1e1bc40f3a1 = []byte{
// 375 bytes of a gzipped FileDescriptorProto
0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 0x36, 0x62, 0x02, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@ -242,7 +242,7 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient {
func (c *msgClient) Register(ctx context.Context, in *MsgRegister, opts ...grpc.CallOption) (*MsgRegisterResponse, error) {
out := new(MsgRegisterResponse)
err := c.cc.Invoke(ctx, "/zgc.committee.v1.Msg/Register", in, out, opts...)
err := c.cc.Invoke(ctx, "/zgc.council.v1.Msg/Register", in, out, opts...)
if err != nil {
return nil, err
}
@ -251,7 +251,7 @@ func (c *msgClient) Register(ctx context.Context, in *MsgRegister, opts ...grpc.
func (c *msgClient) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) {
out := new(MsgVoteResponse)
err := c.cc.Invoke(ctx, "/zgc.committee.v1.Msg/Vote", in, out, opts...)
err := c.cc.Invoke(ctx, "/zgc.council.v1.Msg/Vote", in, out, opts...)
if err != nil {
return nil, err
}
@ -289,7 +289,7 @@ func _Msg_Register_Handler(srv interface{}, ctx context.Context, dec func(interf
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/zgc.committee.v1.Msg/Register",
FullMethod: "/zgc.council.v1.Msg/Register",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).Register(ctx, req.(*MsgRegister))
@ -307,7 +307,7 @@ func _Msg_Vote_Handler(srv interface{}, ctx context.Context, dec func(interface{
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/zgc.committee.v1.Msg/Vote",
FullMethod: "/zgc.council.v1.Msg/Vote",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).Vote(ctx, req.(*MsgVote))
@ -316,7 +316,7 @@ func _Msg_Vote_Handler(srv interface{}, ctx context.Context, dec func(interface{
}
var _Msg_serviceDesc = grpc.ServiceDesc{
ServiceName: "zgc.committee.v1.Msg",
ServiceName: "zgc.council.v1.Msg",
HandlerType: (*MsgServer)(nil),
Methods: []grpc.MethodDesc{
{
@ -329,7 +329,7 @@ var _Msg_serviceDesc = grpc.ServiceDesc{
},
},
Streams: []grpc.StreamDesc{},
Metadata: "zgc/committee/v1/tx.proto",
Metadata: "zgc/council/v1/tx.proto",
}
func (m *MsgRegister) Marshal() (dAtA []byte, err error) {
@ -433,8 +433,8 @@ func (m *MsgVote) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i--
dAtA[i] = 0x12
}
if m.CommitteeID != 0 {
i = encodeVarintTx(dAtA, i, uint64(m.CommitteeID))
if m.CouncilID != 0 {
i = encodeVarintTx(dAtA, i, uint64(m.CouncilID))
i--
dAtA[i] = 0x8
}
@ -507,8 +507,8 @@ func (m *MsgVote) Size() (n int) {
}
var l int
_ = l
if m.CommitteeID != 0 {
n += 1 + sovTx(uint64(m.CommitteeID))
if m.CouncilID != 0 {
n += 1 + sovTx(uint64(m.CouncilID))
}
l = len(m.Voter)
if l > 0 {
@ -735,9 +735,9 @@ func (m *MsgVote) Unmarshal(dAtA []byte) error {
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field CommitteeID", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field CouncilID", wireType)
}
m.CommitteeID = 0
m.CouncilID = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
@ -747,7 +747,7 @@ func (m *MsgVote) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
m.CommitteeID |= uint64(b&0x7F) << shift
m.CouncilID |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}

View File

@ -21,7 +21,7 @@ import (
"github.com/0glabs/0g-chain/x/das/v1/types"
)
// consensusVersion defines the current x/committee module consensus version.
// consensusVersion defines the current x/council module consensus version.
const consensusVersion = 1
// type check to ensure the interface is properly implemented