From a03b46d77f90dbec52b4962e4534710369e488b1 Mon Sep 17 00:00:00 2001 From: Adam Hanna Date: Mon, 16 Sep 2024 16:43:04 -0700 Subject: [PATCH] fin --- go.mod | 7 +- go.sum | 4 +- proto/atomone/gov/v1/genesis.proto | 7 + proto/atomone/gov/v1/query.proto | 13 + x/gov/client/cli/query.go | 23 ++ x/gov/client/cli/query_test.go | 24 ++ x/gov/genesis.go | 3 + x/gov/keeper/constitution.go | 19 ++ x/gov/keeper/grpc_query.go | 7 + x/gov/types/keys.go | 3 + x/gov/types/v1/genesis.pb.go | 106 +++++-- x/gov/types/v1/query.pb.go | 489 ++++++++++++++++++++++++----- x/gov/types/v1/query.pb.gw.go | 65 ++++ 13 files changed, 664 insertions(+), 106 deletions(-) create mode 100644 x/gov/keeper/constitution.go diff --git a/go.mod b/go.mod index 3b02fe1f..1ae1c66a 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,7 @@ require ( cosmossdk.io/math v1.3.0 cosmossdk.io/simapp v0.0.0-20230602123434-616841b9704d cosmossdk.io/tools/rosetta v0.2.1 + github.com/chzyer/readline v1.5.1 github.com/cometbft/cometbft v0.37.4 github.com/cometbft/cometbft-db v0.10.0 github.com/cosmos/cosmos-proto v1.0.0-beta.4 @@ -19,6 +20,7 @@ require ( github.com/golang/mock v1.6.0 github.com/google/gofuzz v1.2.0 github.com/gorilla/mux v1.8.1 + github.com/manifoldco/promptui v0.9.0 github.com/ory/dockertest/v3 v3.10.0 github.com/rakyll/statik v0.1.7 github.com/spf13/cast v1.6.0 @@ -66,7 +68,6 @@ require ( github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect github.com/cockroachdb/errors v1.10.0 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect @@ -145,7 +146,6 @@ require ( github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/linxGnu/grocksdb v1.8.11 // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect @@ -221,4 +221,7 @@ replace ( // following versions might cause unexpected behavior github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 + + // replace broken cosmos-sdk dep + nhooyr.io/websocket => github.com/coder/websocket v1.8.6 ) diff --git a/go.sum b/go.sum index d572dae2..1b51101a 100644 --- a/go.sum +++ b/go.sum @@ -371,6 +371,8 @@ github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7Hpx github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/coder/websocket v1.8.6 h1:OmNKdwUvLj7VvHnl5o8skaVghSPLjWdHGCnFbkWqs9w= +github.com/coder/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= @@ -1953,8 +1955,6 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= -nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= -nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/proto/atomone/gov/v1/genesis.proto b/proto/atomone/gov/v1/genesis.proto index b382bdb8..00ca3697 100644 --- a/proto/atomone/gov/v1/genesis.proto +++ b/proto/atomone/gov/v1/genesis.proto @@ -30,4 +30,11 @@ message GenesisState { // // Since: cosmos-sdk 0.47 Params params = 8; + // The constitution allows builders to lay a foundation and define purpose. + // This is an immutable string set in genesis. + // There are no amendments, to go outside of scope, just fork. + // constitution is an immutable string in genesis for a chain builder to lay out their vision, ideas and ideals. + // + // Since: cosmos-sdk 0.48 + string constitution = 9; } diff --git a/proto/atomone/gov/v1/query.proto b/proto/atomone/gov/v1/query.proto index 9052a450..0a9ac285 100644 --- a/proto/atomone/gov/v1/query.proto +++ b/proto/atomone/gov/v1/query.proto @@ -12,6 +12,11 @@ option go_package = "github.com/atomone-hub/atomone/x/gov/types/v1"; // Query defines the gRPC querier service for gov module service Query { + // Constitution queries the chain's constitution. + rpc Constitution(QueryConstitutionRequest) returns (QueryConstitutionResponse) { + option (google.api.http).get = "/cosmos/gov/v1/constitution"; + } + // Proposal queries proposal details based on ProposalID. rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) { option (google.api.http).get = "/atomone/gov/v1/proposals/{proposal_id}"; @@ -53,6 +58,14 @@ service Query { } } +// QueryConstitutionRequest is the request type for the Query/Constitution RPC method +message QueryConstitutionRequest {} + +// QueryConstitutionResponse is the response type for the Query/Constitution RPC method +message QueryConstitutionResponse { + string constitution = 1; +} + // QueryProposalRequest is the request type for the Query/Proposal RPC method. message QueryProposalRequest { // proposal_id defines the unique id of the proposal. diff --git a/x/gov/client/cli/query.go b/x/gov/client/cli/query.go index be807bd2..89d913d5 100644 --- a/x/gov/client/cli/query.go +++ b/x/gov/client/cli/query.go @@ -39,6 +39,7 @@ func GetQueryCmd() *cobra.Command { GetCmdQueryDeposit(), GetCmdQueryDeposits(), GetCmdQueryTally(), + GetCmdConstitution(), ) return govQueryCmd @@ -653,3 +654,25 @@ $ %s query gov proposer 1 return cmd } + +func GetCmdConstitution() *cobra.Command { + return &cobra.Command{ + Use: "constitution", + Short: "Get the constitution", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + queryClient := v1.NewQueryClient(clientCtx) + + resp, err := queryClient.Constitution(cmd.Context(), &v1.QueryConstitutionRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(resp) + }, + } +} diff --git a/x/gov/client/cli/query_test.go b/x/gov/client/cli/query_test.go index 07ca9be7..68bd901c 100644 --- a/x/gov/client/cli/query_test.go +++ b/x/gov/client/cli/query_test.go @@ -6,6 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/testutil" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/atomone-hub/atomone/x/gov/client/cli" ) @@ -382,3 +383,26 @@ func (s *CLITestSuite) TestCmdQueryVote() { }) } } + +func (s *CLITestSuite) TestCmdGetConstitution() { + testCases := []struct { + name string + expOutput string + }{ + { + name: "get constitution", + expOutput: "constitution", + }, + } + + for _, tc := range testCases { + tc := tc + + s.Run(tc.name, func() { + cmd := cli.GetCmdConstitution() + out, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, []string{}) + s.Require().NoError(err) + s.Require().Contains(out.String(), tc.expOutput) + }) + } +} diff --git a/x/gov/genesis.go b/x/gov/genesis.go index b6f928d8..47723db2 100644 --- a/x/gov/genesis.go +++ b/x/gov/genesis.go @@ -16,6 +16,7 @@ func InitGenesis(ctx sdk.Context, ak types.AccountKeeper, bk types.BankKeeper, k if err := k.SetParams(ctx, *data.Params); err != nil { panic(fmt.Sprintf("%s module params has not been set", types.ModuleName)) } + k.SetConstitution(ctx, data.Constitution) // check if the deposits pool account exists moduleAcc := k.GetGovernanceAccount(ctx) @@ -60,6 +61,7 @@ func ExportGenesis(ctx sdk.Context, k *keeper.Keeper) *v1.GenesisState { startingProposalID, _ := k.GetProposalID(ctx) proposals := k.GetProposals(ctx) params := k.GetParams(ctx) + constitution := k.GetConstitution(ctx) var proposalsDeposits v1.Deposits var proposalsVotes v1.Votes @@ -77,5 +79,6 @@ func ExportGenesis(ctx sdk.Context, k *keeper.Keeper) *v1.GenesisState { Votes: proposalsVotes, Proposals: proposals, Params: ¶ms, + Constitution: constitution, } } diff --git a/x/gov/keeper/constitution.go b/x/gov/keeper/constitution.go new file mode 100644 index 00000000..593e4abe --- /dev/null +++ b/x/gov/keeper/constitution.go @@ -0,0 +1,19 @@ +package keeper + +import ( + "github.com/atomone-hub/atomone/x/gov/types" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (keeper Keeper) GetConstitution(ctx sdk.Context) (constitution string) { + store := ctx.KVStore(keeper.storeKey) + bz := store.Get(types.KeyConstitution) + + return string(bz) +} + +func (keeper Keeper) SetConstitution(ctx sdk.Context, constitution string) { + store := ctx.KVStore(keeper.storeKey) + store.Set([]byte(types.KeyConstitution), []byte(constitution)) +} diff --git a/x/gov/keeper/grpc_query.go b/x/gov/keeper/grpc_query.go index 8314d898..b7721de1 100644 --- a/x/gov/keeper/grpc_query.go +++ b/x/gov/keeper/grpc_query.go @@ -18,6 +18,13 @@ import ( var _ v1.QueryServer = Keeper{} +func (q Keeper) Constitution(c context.Context, req *v1.QueryConstitutionRequest) (*v1.QueryConstitutionResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + constitution := q.GetConstitution(ctx) + + return &v1.QueryConstitutionResponse{Constitution: constitution}, nil +} + // Proposal returns proposal details based on ProposalID func (q Keeper) Proposal(c context.Context, req *v1.QueryProposalRequest) (*v1.QueryProposalResponse, error) { if req == nil { diff --git a/x/gov/types/keys.go b/x/gov/types/keys.go index 3aebc6c9..4725685f 100644 --- a/x/gov/types/keys.go +++ b/x/gov/types/keys.go @@ -51,6 +51,9 @@ var ( // ParamsKey is the key to query all gov params ParamsKey = []byte{0x30} + + // KeyConstitution is the key string used to store the chain's constitution + KeyConstitution = []byte("constitution") ) var lenTime = len(sdk.FormatTimeBytes(time.Now())) diff --git a/x/gov/types/v1/genesis.pb.go b/x/gov/types/v1/genesis.pb.go index a761a4d3..661c9bc5 100644 --- a/x/gov/types/v1/genesis.pb.go +++ b/x/gov/types/v1/genesis.pb.go @@ -45,6 +45,13 @@ type GenesisState struct { // // Since: cosmos-sdk 0.47 Params *Params `protobuf:"bytes,8,opt,name=params,proto3" json:"params,omitempty"` + // The constitution allows builders to lay a foundation and define purpose. + // This is an immutable string set in genesis. + // There are no amendments, to go outside of scope, just fork. + // constitution is an immutable string in genesis for a chain builder to lay out their vision, ideas and ideals. + // + // Since: cosmos-sdk 0.48 + Constitution string `protobuf:"bytes,9,opt,name=constitution,proto3" json:"constitution,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -139,6 +146,13 @@ func (m *GenesisState) GetParams() *Params { return nil } +func (m *GenesisState) GetConstitution() string { + if m != nil { + return m.Constitution + } + return "" +} + func init() { proto.RegisterType((*GenesisState)(nil), "atomone.gov.v1.GenesisState") } @@ -146,30 +160,31 @@ func init() { func init() { proto.RegisterFile("atomone/gov/v1/genesis.proto", fileDescriptor_7737a96fb154b10d) } var fileDescriptor_7737a96fb154b10d = []byte{ - // 358 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xcd, 0x4e, 0x02, 0x31, - 0x14, 0x85, 0x29, 0x7f, 0x62, 0xf9, 0x59, 0x34, 0x44, 0x1b, 0xc5, 0x09, 0x71, 0x45, 0x4c, 0xe8, - 0x08, 0x24, 0x3e, 0x00, 0xd1, 0xa0, 0x3b, 0x32, 0x1a, 0x17, 0x6e, 0x48, 0x71, 0x9a, 0x61, 0x12, - 0xe0, 0x4e, 0xa6, 0xa5, 0x91, 0xb7, 0xf0, 0xb1, 0x5c, 0xb2, 0x74, 0x65, 0x0c, 0xbc, 0x88, 0xa1, - 0x33, 0x23, 0x38, 0xea, 0xae, 0xb9, 0xe7, 0x3b, 0xa7, 0x27, 0x37, 0x17, 0x37, 0xb8, 0x82, 0x19, - 0xcc, 0x85, 0xed, 0x81, 0xb6, 0x75, 0xc7, 0xf6, 0xc4, 0x5c, 0x48, 0x5f, 0xb2, 0x20, 0x04, 0x05, - 0xa4, 0x16, 0xab, 0xcc, 0x03, 0xcd, 0x74, 0xe7, 0x84, 0xa6, 0x69, 0xd0, 0x11, 0x79, 0xfe, 0x91, - 0xc3, 0x95, 0x41, 0xe4, 0xbd, 0x57, 0x5c, 0x09, 0x72, 0x89, 0xeb, 0x52, 0xf1, 0x50, 0xf9, 0x73, - 0x6f, 0x14, 0x84, 0x10, 0x80, 0xe4, 0xd3, 0x91, 0xef, 0x52, 0xd4, 0x44, 0xad, 0xbc, 0x43, 0x12, - 0x6d, 0x18, 0x4b, 0x77, 0x2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b5, 0xa8, 0x65, 0x20, - 0xa4, 0xad, 0x3b, 0xe3, 0xa2, 0x39, 0x98, 0xde, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0c, 0x1f, - 0x36, 0x2b, 0x7a, 0x02, 0x00, 0x00, + // 380 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xcf, 0xaa, 0xda, 0x40, + 0x14, 0xc6, 0x1d, 0xff, 0x55, 0xc7, 0xe8, 0x62, 0x90, 0x76, 0x68, 0x6d, 0x08, 0xae, 0x42, 0xc1, + 0xa4, 0x2a, 0xf4, 0x01, 0xa4, 0xc5, 0x76, 0x27, 0x69, 0xe9, 0xa2, 0x1b, 0x89, 0x66, 0x88, 0x01, + 0xcd, 0x09, 0x99, 0xe3, 0x50, 0xb7, 0x7d, 0x82, 0x3e, 0x56, 0x97, 0x2e, 0xbb, 0x2c, 0xfa, 0x22, + 0xc5, 0x49, 0x72, 0xd5, 0xdc, 0x7b, 0x77, 0xc3, 0xf9, 0x7e, 0xdf, 0x77, 0x3e, 0x0e, 0x43, 0x07, + 0x3e, 0xc2, 0x0e, 0x62, 0xe1, 0x86, 0xa0, 0x5c, 0x35, 0x76, 0x43, 0x11, 0x0b, 0x19, 0x49, 0x27, + 0x49, 0x01, 0x81, 0xf5, 0x72, 0xd5, 0x09, 0x41, 0x39, 0x6a, 0xfc, 0x9a, 0x97, 0x69, 0x50, 0x19, + 0x39, 0xfc, 0x55, 0xa7, 0xc6, 0x3c, 0xf3, 0x7e, 0x45, 0x1f, 0x05, 0x7b, 0x4f, 0xfb, 0x12, 0xfd, + 0x14, 0xa3, 0x38, 0x5c, 0x26, 0x29, 0x24, 0x20, 0xfd, 0xed, 0x32, 0x0a, 0x38, 0xb1, 0x88, 0x5d, + 0xf7, 0x58, 0xa1, 0x2d, 0x72, 0xe9, 0x4b, 0xc0, 0xa6, 0xb4, 0x15, 0x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0xb3, 0x5f, 0x39, 0x6b, 0xd8, 0xb9, 0xf9, 0x9e, 0xd1, 0x66, 0xbf, 0x2a, 0xde, 0xee, + 0x4f, 0xfd, 0xa3, 0xf0, 0x90, 0x08, 0xe9, 0xaa, 0xf1, 0xaa, 0xa9, 0x3f, 0xd5, 0xf4, 0x7f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x19, 0xfd, 0x88, 0xa5, 0x9e, 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -192,6 +207,13 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Constitution) > 0 { + i -= len(m.Constitution) + copy(dAtA[i:], m.Constitution) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Constitution))) + i-- + dAtA[i] = 0x4a + } if m.Params != nil { { size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) @@ -344,6 +366,10 @@ func (m *GenesisState) Size() (n int) { l = m.Params.Size() n += 1 + l + sovGenesis(uint64(l)) } + l = len(m.Constitution) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } return n } @@ -647,6 +673,38 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Constitution", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Constitution = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/gov/types/v1/query.pb.go b/x/gov/types/v1/query.pb.go index 8d29bb15..884a4538 100644 --- a/x/gov/types/v1/query.pb.go +++ b/x/gov/types/v1/query.pb.go @@ -30,6 +30,88 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// QueryConstitutionRequest is the request type for the Query/Constitution RPC method +type QueryConstitutionRequest struct { +} + +func (m *QueryConstitutionRequest) Reset() { *m = QueryConstitutionRequest{} } +func (m *QueryConstitutionRequest) String() string { return proto.CompactTextString(m) } +func (*QueryConstitutionRequest) ProtoMessage() {} +func (*QueryConstitutionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2290d0188dd70223, []int{0} +} +func (m *QueryConstitutionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryConstitutionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryConstitutionRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryConstitutionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryConstitutionRequest.Merge(m, src) +} +func (m *QueryConstitutionRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryConstitutionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryConstitutionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryConstitutionRequest proto.InternalMessageInfo + +// QueryConstitutionResponse is the response type for the Query/Constitution RPC method +type QueryConstitutionResponse struct { + Constitution string `protobuf:"bytes,1,opt,name=constitution,proto3" json:"constitution,omitempty"` +} + +func (m *QueryConstitutionResponse) Reset() { *m = QueryConstitutionResponse{} } +func (m *QueryConstitutionResponse) String() string { return proto.CompactTextString(m) } +func (*QueryConstitutionResponse) ProtoMessage() {} +func (*QueryConstitutionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2290d0188dd70223, []int{1} +} +func (m *QueryConstitutionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryConstitutionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryConstitutionResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryConstitutionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryConstitutionResponse.Merge(m, src) +} +func (m *QueryConstitutionResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryConstitutionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryConstitutionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryConstitutionResponse proto.InternalMessageInfo + +func (m *QueryConstitutionResponse) GetConstitution() string { + if m != nil { + return m.Constitution + } + return "" +} + // QueryProposalRequest is the request type for the Query/Proposal RPC method. type QueryProposalRequest struct { // proposal_id defines the unique id of the proposal. @@ -40,7 +122,7 @@ func (m *QueryProposalRequest) Reset() { *m = QueryProposalRequest{} } func (m *QueryProposalRequest) String() string { return proto.CompactTextString(m) } func (*QueryProposalRequest) ProtoMessage() {} func (*QueryProposalRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2290d0188dd70223, []int{0} + return fileDescriptor_2290d0188dd70223, []int{2} } func (m *QueryProposalRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -86,7 +168,7 @@ func (m *QueryProposalResponse) Reset() { *m = QueryProposalResponse{} } func (m *QueryProposalResponse) String() string { return proto.CompactTextString(m) } func (*QueryProposalResponse) ProtoMessage() {} func (*QueryProposalResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2290d0188dd70223, []int{1} + return fileDescriptor_2290d0188dd70223, []int{3} } func (m *QueryProposalResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -138,7 +220,7 @@ func (m *QueryProposalsRequest) Reset() { *m = QueryProposalsRequest{} } func (m *QueryProposalsRequest) String() string { return proto.CompactTextString(m) } func (*QueryProposalsRequest) ProtoMessage() {} func (*QueryProposalsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2290d0188dd70223, []int{2} + return fileDescriptor_2290d0188dd70223, []int{4} } func (m *QueryProposalsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -208,7 +290,7 @@ func (m *QueryProposalsResponse) Reset() { *m = QueryProposalsResponse{} func (m *QueryProposalsResponse) String() string { return proto.CompactTextString(m) } func (*QueryProposalsResponse) ProtoMessage() {} func (*QueryProposalsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2290d0188dd70223, []int{3} + return fileDescriptor_2290d0188dd70223, []int{5} } func (m *QueryProposalsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -263,7 +345,7 @@ func (m *QueryVoteRequest) Reset() { *m = QueryVoteRequest{} } func (m *QueryVoteRequest) String() string { return proto.CompactTextString(m) } func (*QueryVoteRequest) ProtoMessage() {} func (*QueryVoteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2290d0188dd70223, []int{4} + return fileDescriptor_2290d0188dd70223, []int{6} } func (m *QueryVoteRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -316,7 +398,7 @@ func (m *QueryVoteResponse) Reset() { *m = QueryVoteResponse{} } func (m *QueryVoteResponse) String() string { return proto.CompactTextString(m) } func (*QueryVoteResponse) ProtoMessage() {} func (*QueryVoteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2290d0188dd70223, []int{5} + return fileDescriptor_2290d0188dd70223, []int{7} } func (m *QueryVoteResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -364,7 +446,7 @@ func (m *QueryVotesRequest) Reset() { *m = QueryVotesRequest{} } func (m *QueryVotesRequest) String() string { return proto.CompactTextString(m) } func (*QueryVotesRequest) ProtoMessage() {} func (*QueryVotesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2290d0188dd70223, []int{6} + return fileDescriptor_2290d0188dd70223, []int{8} } func (m *QueryVotesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -419,7 +501,7 @@ func (m *QueryVotesResponse) Reset() { *m = QueryVotesResponse{} } func (m *QueryVotesResponse) String() string { return proto.CompactTextString(m) } func (*QueryVotesResponse) ProtoMessage() {} func (*QueryVotesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2290d0188dd70223, []int{7} + return fileDescriptor_2290d0188dd70223, []int{9} } func (m *QueryVotesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -473,7 +555,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2290d0188dd70223, []int{8} + return fileDescriptor_2290d0188dd70223, []int{10} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -530,7 +612,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2290d0188dd70223, []int{9} + return fileDescriptor_2290d0188dd70223, []int{11} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -602,7 +684,7 @@ func (m *QueryDepositRequest) Reset() { *m = QueryDepositRequest{} } func (m *QueryDepositRequest) String() string { return proto.CompactTextString(m) } func (*QueryDepositRequest) ProtoMessage() {} func (*QueryDepositRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2290d0188dd70223, []int{10} + return fileDescriptor_2290d0188dd70223, []int{12} } func (m *QueryDepositRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -655,7 +737,7 @@ func (m *QueryDepositResponse) Reset() { *m = QueryDepositResponse{} } func (m *QueryDepositResponse) String() string { return proto.CompactTextString(m) } func (*QueryDepositResponse) ProtoMessage() {} func (*QueryDepositResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2290d0188dd70223, []int{11} + return fileDescriptor_2290d0188dd70223, []int{13} } func (m *QueryDepositResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -703,7 +785,7 @@ func (m *QueryDepositsRequest) Reset() { *m = QueryDepositsRequest{} } func (m *QueryDepositsRequest) String() string { return proto.CompactTextString(m) } func (*QueryDepositsRequest) ProtoMessage() {} func (*QueryDepositsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2290d0188dd70223, []int{12} + return fileDescriptor_2290d0188dd70223, []int{14} } func (m *QueryDepositsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -758,7 +840,7 @@ func (m *QueryDepositsResponse) Reset() { *m = QueryDepositsResponse{} } func (m *QueryDepositsResponse) String() string { return proto.CompactTextString(m) } func (*QueryDepositsResponse) ProtoMessage() {} func (*QueryDepositsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2290d0188dd70223, []int{13} + return fileDescriptor_2290d0188dd70223, []int{15} } func (m *QueryDepositsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -811,7 +893,7 @@ func (m *QueryTallyResultRequest) Reset() { *m = QueryTallyResultRequest func (m *QueryTallyResultRequest) String() string { return proto.CompactTextString(m) } func (*QueryTallyResultRequest) ProtoMessage() {} func (*QueryTallyResultRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2290d0188dd70223, []int{14} + return fileDescriptor_2290d0188dd70223, []int{16} } func (m *QueryTallyResultRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -857,7 +939,7 @@ func (m *QueryTallyResultResponse) Reset() { *m = QueryTallyResultRespon func (m *QueryTallyResultResponse) String() string { return proto.CompactTextString(m) } func (*QueryTallyResultResponse) ProtoMessage() {} func (*QueryTallyResultResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2290d0188dd70223, []int{15} + return fileDescriptor_2290d0188dd70223, []int{17} } func (m *QueryTallyResultResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -894,6 +976,8 @@ func (m *QueryTallyResultResponse) GetTally() *TallyResult { } func init() { + proto.RegisterType((*QueryConstitutionRequest)(nil), "atomone.gov.v1.QueryConstitutionRequest") + proto.RegisterType((*QueryConstitutionResponse)(nil), "atomone.gov.v1.QueryConstitutionResponse") proto.RegisterType((*QueryProposalRequest)(nil), "atomone.gov.v1.QueryProposalRequest") proto.RegisterType((*QueryProposalResponse)(nil), "atomone.gov.v1.QueryProposalResponse") proto.RegisterType((*QueryProposalsRequest)(nil), "atomone.gov.v1.QueryProposalsRequest") @@ -915,68 +999,72 @@ func init() { func init() { proto.RegisterFile("atomone/gov/v1/query.proto", fileDescriptor_2290d0188dd70223) } var fileDescriptor_2290d0188dd70223 = []byte{ - // 971 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xdd, 0x6e, 0xdc, 0x44, - 0x14, 0x8e, 0x37, 0x3f, 0xdd, 0x3d, 0x69, 0x03, 0x1c, 0x42, 0xeb, 0xba, 0x65, 0x49, 0x4d, 0x48, - 0x42, 0x45, 0x3c, 0x6c, 0x4a, 0x5a, 0x84, 0x28, 0x12, 0x51, 0x69, 0xe8, 0x05, 0x52, 0xd8, 0x56, - 0x5c, 0x70, 0x13, 0x39, 0x59, 0xcb, 0xb5, 0xb4, 0xf1, 0xb8, 0x3b, 0xb3, 0x2b, 0xa2, 0xb0, 0xaa, - 0x84, 0x84, 0x04, 0x5c, 0x15, 0x21, 0x84, 0xe8, 0x73, 0xf0, 0x10, 0x5c, 0x56, 0x70, 0xc3, 0x25, - 0x4a, 0x78, 0x02, 0x9e,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 0x47, 0x31, 0x59, 0xc1, 0xe5, 0x53, 0x4c, - 0x14, 0x8e, 0x1d, 0x65, 0x9e, 0x8d, 0x3e, 0x3e, 0x35, 0xe0, 0x1c, 0xed, 0x24, 0x96, 0xbb, 0xcf, - 0x4b, 0xa4, 0xb5, 0x3c, 0x1a, 0x44, 0x24, 0xee, 0x28, 0x12, 0x1f, 0xe1, 0x87, 0x93, 0x96, 0x23, - 0x91, 0x03, 0x76, 0x94, 0x8a, 0x66, 0x1f, 0x7f, 0x34, 0xa0, 0x9a, 0x88, 0x0c, 0x8e, 0x0c, 0x2c, - 0x46, 0x2f, 0x4f, 0x51, 0xa9, 0xec, 0xf7, 0x15, 0xbf, 0x0d, 0x7c, 0xf7, 0xac, 0xfc, 0xf0, 0x17, - 0x03, 0xe6, 0x33, 0x1b, 0x8f, 0xab, 0xa5, 0x01, 0x4f, 0x6b, 0x90, 0xb5, 0x36, 0x1e, 0xf8, 0xbc, - 0xb3, 0xa4, 0x44, 0x67, 0x6b, 0xfb, 0xf7, 0xe3, 0xba, 0xf1, 0xec, 0xb8, 0x6e, 0xfc, 0x7d, 0x5c, - 0x37, 0x9e, 0x9c, 0xd4, 0xa7, 0x9e, 0x9d, 0xd4, 0xa7, 0xfe, 0x3a, 0xa9, 0x4f, 0x7d, 0xb9, 0xee, - 0x07, 0xf2, 0x61, 0x77, 0xcf, 0xd9, 0xe7, 0x07, 0x89, 0xcb, 0xf5, 0x87, 0xdd, 0xbd, 0xd4, 0xfd, - 0x57, 0x2a, 0x40, 0x3c, 0x10, 0x22, 0xfe, 0xfb, 0x32, 0xa7, 0xfe, 0x5c, 0xdc, 0xf8, 0x2f, 0x00, - 0x00, 0xff, 0xff, 0x34, 0x71, 0xdf, 0xcf, 0x09, 0x0d, 0x00, 0x00, + // 1033 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x5f, 0x6f, 0xdc,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f, 0xbe, 0x3c, + 0xc5, 0xa6, 0x69, 0xbe, 0x27, 0xf5, 0xad, 0xe3, 0x3b, 0xa7, 0xd5, 0x87, 0xbf, 0x6a, 0x30, 0x93, + 0x69, 0x3e, 0xb8, 0x52, 0xea, 0xf0, 0x64, 0x3b, 0x34, 0x56, 0x87, 0x03, 0x5f, 0xb4, 0x96, 0x64, + 0xff, 0xdb, 0xdc, 0xfa, 0xe3, 0xa8, 0xa6, 0x3d, 0x3f, 0xaa, 0x69, 0xff, 0x1c, 0xd5, 0xb4, 0xa7, + 0xc7, 0xb5, 0xb1, 0xe7, 0xc7, 0xb5, 0xb1, 0xbf, 0x8f, 0x6b, 0x63, 0x5f, 0xad, 0xf9, 0x81, 0x78, + 0xd4, 0xde, 0xb5, 0xf6, 0xd8, 0x7e, 0x42, 0xb9, 0xf6, 0xa8, 0xbd, 0x9b, 0xd2, 0x7f, 0x2d, 0x1d, + 0xc4, 0x05, 0xc1, 0xe3, 0xdf, 0xb4, 0x29, 0xf9, 0x13, 0x75, 0xf3, 0xff, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x3d, 0x6b, 0xab, 0x63, 0xf1, 0x0d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -991,6 +1079,8 @@ 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 { + // Constitution queries the chain's constitution. + Constitution(ctx context.Context, in *QueryConstitutionRequest, opts ...grpc.CallOption) (*QueryConstitutionResponse, error) // Proposal queries proposal details based on ProposalID. Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) // Proposals queries all proposals based on given status. @@ -1017,6 +1107,15 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } +func (c *queryClient) Constitution(ctx context.Context, in *QueryConstitutionRequest, opts ...grpc.CallOption) (*QueryConstitutionResponse, error) { + out := new(QueryConstitutionResponse) + err := c.cc.Invoke(ctx, "/atomone.gov.v1.Query/Constitution", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) { out := new(QueryProposalResponse) err := c.cc.Invoke(ctx, "/atomone.gov.v1.Query/Proposal", in, out, opts...) @@ -1091,6 +1190,8 @@ func (c *queryClient) TallyResult(ctx context.Context, in *QueryTallyResultReque // QueryServer is the server API for Query service. type QueryServer interface { + // Constitution queries the chain's constitution. + Constitution(context.Context, *QueryConstitutionRequest) (*QueryConstitutionResponse, error) // Proposal queries proposal details based on ProposalID. Proposal(context.Context, *QueryProposalRequest) (*QueryProposalResponse, error) // Proposals queries all proposals based on given status. @@ -1113,6 +1214,9 @@ type QueryServer interface { type UnimplementedQueryServer struct { } +func (*UnimplementedQueryServer) Constitution(ctx context.Context, req *QueryConstitutionRequest) (*QueryConstitutionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Constitution not implemented") +} func (*UnimplementedQueryServer) Proposal(ctx context.Context, req *QueryProposalRequest) (*QueryProposalResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Proposal not implemented") } @@ -1142,6 +1246,24 @@ func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) } +func _Query_Constitution_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryConstitutionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Constitution(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/atomone.gov.v1.Query/Constitution", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Constitution(ctx, req.(*QueryConstitutionRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_Proposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryProposalRequest) if err := dec(in); err != nil { @@ -1290,6 +1412,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "atomone.gov.v1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "Constitution", + Handler: _Query_Constitution_Handler, + }, { MethodName: "Proposal", Handler: _Query_Proposal_Handler, @@ -1327,6 +1453,59 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Metadata: "atomone/gov/v1/query.proto", } +func (m *QueryConstitutionRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryConstitutionRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryConstitutionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryConstitutionResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryConstitutionResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryConstitutionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Constitution) > 0 { + i -= len(m.Constitution) + copy(dAtA[i:], m.Constitution) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Constitution))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *QueryProposalRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1986,6 +2165,28 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *QueryConstitutionRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryConstitutionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Constitution) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func (m *QueryProposalRequest) Size() (n int) { if m == nil { return 0 @@ -2251,6 +2452,138 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *QueryConstitutionRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryConstitutionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryConstitutionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryConstitutionResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryConstitutionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryConstitutionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Constitution", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Constitution = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryProposalRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/gov/types/v1/query.pb.gw.go b/x/gov/types/v1/query.pb.gw.go index 57431991..58b48640 100644 --- a/x/gov/types/v1/query.pb.gw.go +++ b/x/gov/types/v1/query.pb.gw.go @@ -33,6 +33,24 @@ var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage var _ = metadata.Join +func request_Query_Constitution_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryConstitutionRequest + var metadata runtime.ServerMetadata + + msg, err := client.Constitution(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Constitution_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryConstitutionRequest + var metadata runtime.ServerMetadata + + msg, err := server.Constitution(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_Proposal_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryProposalRequest var metadata runtime.ServerMetadata @@ -533,6 +551,29 @@ func local_request_Query_TallyResult_0(ctx context.Context, marshaler runtime.Ma // 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_Constitution_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Constitution_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 { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Constitution_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_Proposal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -758,6 +799,26 @@ 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_Constitution_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) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Constitution_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_Constitution_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_Proposal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -922,6 +983,8 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( + pattern_Query_Constitution_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "gov", "v1", "constitution"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Proposal_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"atomone", "gov", "v1", "proposals", "proposal_id"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_Proposals_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"atomone", "gov", "v1", "proposals"}, "", runtime.AssumeColonVerbOpt(false))) @@ -940,6 +1003,8 @@ var ( ) var ( + forward_Query_Constitution_0 = runtime.ForwardResponseMessage + forward_Query_Proposal_0 = runtime.ForwardResponseMessage forward_Query_Proposals_0 = runtime.ForwardResponseMessage