From 716d0ef4366983dcca09abd9f4cd4834d6db65f8 Mon Sep 17 00:00:00 2001 From: Kehinde Faleye Date: Thu, 10 Oct 2024 15:49:21 +0100 Subject: [PATCH] feat: add in query platform fee into xion module (#273) This PR adds in CLI query feature for the platform fee into the xion module --- client/docs/static/openapi.json | 9 + client/docs/static/swagger.json | 9 + proto/xion/v1/query.proto | 9 +- x/jwk/types/query.pb.go | 92 +++--- x/mint/common_test.go | 1 - x/xion/client/cli/query.go | 1 + x/xion/client/cli/query_platform_fee.go | 38 +++ x/xion/keeper/keeper.go | 9 + x/xion/types/query.pb.go | 359 ++++++++++++++++++++++-- 9 files changed, 456 insertions(+), 71 deletions(-) create mode 100644 x/xion/client/cli/query_platform_fee.go diff --git a/client/docs/static/openapi.json b/client/docs/static/openapi.json index db1433bc..c198a8e5 100644 --- a/client/docs/static/openapi.json +++ b/client/docs/static/openapi.json @@ -51010,6 +51010,15 @@ }, "description": "QueryParamsResponse is the response type for the Query/Params RPC method." }, + "xion.v1.QueryPlatformPercentageResponse": { + "type": "object", + "properties": { + "platform_percentage": { + "type": "string", + "format": "uint64" + } + } + }, "xion.v1.QueryWebAuthNVerifyAuthenticateResponse": { "type": "object" }, diff --git a/client/docs/static/swagger.json b/client/docs/static/swagger.json index 512f338a..9817feaf 100644 --- a/client/docs/static/swagger.json +++ b/client/docs/static/swagger.json @@ -48372,6 +48372,15 @@ }, "description": "QueryParamsResponse is the response type for the Query/Params RPC method." }, + "xion.v1.QueryPlatformPercentageResponse": { + "type": "object", + "properties": { + "platform_percentage": { + "type": "string", + "format": "uint64" + } + } + }, "xion.v1.QueryWebAuthNVerifyAuthenticateResponse": { "type": "object" }, diff --git a/proto/xion/v1/query.proto b/proto/xion/v1/query.proto index bd396333..80292d66 100644 --- a/proto/xion/v1/query.proto +++ b/proto/xion/v1/query.proto @@ -6,6 +6,7 @@ option go_package = "github.com/burnt-labs/xion/x/xion/types"; service Query { rpc WebAuthNVerifyRegister(QueryWebAuthNVerifyRegisterRequest) returns (QueryWebAuthNVerifyRegisterResponse) {} rpc WebAuthNVerifyAuthenticate(QueryWebAuthNVerifyAuthenticateRequest) returns (QueryWebAuthNVerifyAuthenticateResponse) {} + rpc PlatformPercentage(QueryPlatformPercentageRequest) returns (QueryPlatformPercentageResponse) {} } message QueryWebAuthNVerifyRegisterRequest { @@ -27,4 +28,10 @@ message QueryWebAuthNVerifyAuthenticateRequest { bytes data = 5; } -message QueryWebAuthNVerifyAuthenticateResponse {} \ No newline at end of file +message QueryWebAuthNVerifyAuthenticateResponse {} + +message QueryPlatformPercentageRequest {} + +message QueryPlatformPercentageResponse { + uint64 platform_percentage = 1; +} \ No newline at end of file diff --git a/x/jwk/types/query.pb.go b/x/jwk/types/query.pb.go index f5a5d643..8625a2ca 100644 --- a/x/jwk/types/query.pb.go +++ b/x/jwk/types/query.pb.go @@ -558,52 +558,52 @@ func init() { func init() { proto.RegisterFile("xion/jwk/v1/query.proto", fileDescriptor_6aa237fef6ed9f02) } var fileDescriptor_6aa237fef6ed9f02 = []byte{ - // 708 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0xc1, 0x4f, 0xd4, 0x4e, - 0x18, 0xdd, 0x02, 0x4b, 0x60, 0x16, 0x12, 0x32, 0xec, 0x2f, 0xec, 0xaf, 0xc1, 0x05, 0x27, 0x0a, - 0x8a, 0xa1, 0xe3, 0x62, 0xd4, 0xa3, 0x82, 0x89, 0x18, 0x4f, 0x50, 0x8d, 0x46, 0x3d, 0x90, 0xe9, - 0xee, 0xa4, 0x94, 0xed, 0x76, 0xca, 0xce, 0xb4, 0xb0, 0x21, 0x5c, 0xbc, 0x78, 0x54, 0xe3, 0xd5, - 0x3f, 0x88, 0x23, 0x89, 0x17, 0x4f, 0xc6, 0x80, 0x7f, 0x88, 0xe9, 0xcc, 0x74, 0x69, 0xd9, 0xae, - 0x70, 0xd9, 0x4c, 0x67, 0xde, 0xf7, 0xde, 0xeb, 0xf7, 0xcd, 0xdb, 0x82, 0xb9, 0x43, 0x8f, 0x05, - 0x78, 0xef, 0xa0, 0x8d, 0xe3, 0x06, 0xde, 0x8f, 0x68, 0xb7, 0x67, 0x85, 0x5d, 0x26, 0x18, 0xac, - 0x24, 0x07, 0xd6, 0xde, 0x41, 0xdb, 0x8a, 0x1b, 0x66, 0xd5, 0x65, 0x2e, 0x93, 0xfb, 0x38, 0x59, - 0x29, 0x88, 0x39, 0xef, 0x32, 0xe6, 0xfa, 0x14, 0x93, 0xd0, 0xc3, 0x24, 0x08, 0x98, 0x20, 0xc2, - 0x63, 0x01, 0xd7, 0xa7, 0x2b, 0x4d, 0xc6, 0x3b, 0x8c, 0x63, 0x87, 0x70, 0xaa, 0x98, 0x71, 0xdc, - 0x70, 0xa8, 0x20, 0x0d, 0x1c, 0x12, 0xd7, 0x0b, 0x24, 0x58, 0x63, 0x6b, 0x59, 0x17, 0x21, 0xe9, - 0x92, 0x4e, 0xca, 0x62, 0x66, 0x4f, 0x48, 0xd4, 0xf2, 0x68, 0xd0, 0xa4, 0xea, 0x0c, 0x55, 0x01, - 0xdc, 0x4e, 0x78, 0xb7, 0x64, 0x81, 0x4d, 0xf7, 0x23, 0xca, 0x05, 0x7a, 0x01, 0x66, 0x73, 0xbb, - 0x3c, 0x64, 0x01, 0xa7, 0xb0, 0x01, 0xc6, 0x15, 0x71, 0xcd, 0x58, 0x34, 0xee, 0x54, 0xd6, 0x66, - 0xad, 0xcc, 0x0b, 0x5a, 0x0a, 0xbc, 0x31, 0x76, 0xf2, 0x6b, 0xa1, 0x64, 0x6b, 0x20, 0x5a, 0x03, - 0xf3, 0x92, 0x69, 0x93, 0x8a, 0x75, 0xad, 0xfc, 0xcc, 0x27, 0x5e, 0x47, 0x2b, 0x41, 0x08, 0xc6, - 0x76, 0x09, 0xdf, 0x95, 0x84, 0x53, 0xb6, 0x5c, 0xa3, 0x6d, 0x70, 0x63, 0x48, 0x8d, 0x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, 0x5f, 0x9d, 0x8e, 0xe3, 0x8d, 0xa7, - 0x27, 0x67, 0x75, 0xe3, 0xf4, 0xac, 0x6e, 0xfc, 0x3e, 0xab, 0x1b, 0x5f, 0xce, 0xeb, 0xa5, 0xd3, - 0xf3, 0x7a, 0xe9, 0xe7, 0x79, 0xbd, 0xf4, 0x7e, 0xc9, 0xf5, 0xc4, 0x6e, 0xe4, 0x58, 0x4d, 0xd6, - 0xc1, 0x4e, 0xd4, 0x0d, 0xc4, 0xaa, 0x4f, 0x1c, 0xae, 0xd8, 0x0f, 0x25, 0xbf, 0xe8, 0x85, 0x94, - 0x3b, 0xe3, 0xf2, 0x6b, 0xf1, 0xe0, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3e, 0x7a, 0x9f, 0xe0, - 0xeb, 0x06, 0x00, 0x00, + // 706 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x95, 0xc1, 0x4f, 0xd4, 0x4a, + 0x1c, 0xc7, 0xb7, 0xc0, 0x12, 0x98, 0x85, 0x84, 0x0c, 0xfb, 0xc2, 0xbe, 0x86, 0xb7, 0xf0, 0x26, + 0xef, 0x81, 0x62, 0xe8, 0xb8, 0x18, 0xf5, 0xa8, 0x60, 0x22, 0xc6, 0x13, 0x54, 0xa3, 0x51, 0x0f, + 0x64, 0xba, 0x3b, 0x29, 0x65, 0xbb, 0x9d, 0xb2, 0x33, 0x2d, 0x6c, 0x08, 0x17, 0x2f, 0x1e, 0xd5, + 0x78, 0xf5, 0x0f, 0xe2, 0x48, 0xe2, 0xc5, 0x93, 0x31, 0xe0, 0x1f, 0x62, 0x3a, 0x33, 0x85, 0x96, + 0x76, 0x85, 0x0b, 0x99, 0x9d, 0xf9, 0xfe, 0xbe, 0xdf, 0x4f, 0x67, 0x7e, 0xbf, 0x00, 0xe6, 0x0e, + 0x3d, 0x16, 0xe0, 0xbd, 0x83, 0x2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c6, 0xa7, 0xf3, 0x66, 0xe5, 0xf4, 0xbc, 0x59, + 0xf9, 0x7e, 0xde, 0xac, 0xbc, 0x5d, 0x72, 0x3d, 0xb1, 0x1b, 0x39, 0x56, 0x9b, 0xf5, 0xb0, 0x13, + 0xf5, 0x03, 0xb1, 0xea, 0x13, 0x87, 0x2b, 0xf7, 0x43, 0xe9, 0x2f, 0x06, 0x21, 0xe5, 0xce, 0xb8, + 0xfc, 0x6f, 0x71, 0xef, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x19, 0x5a, 0xe3, 0xba, 0xeb, 0x06, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/mint/common_test.go b/x/mint/common_test.go index 31d7117f..4d7417f1 100644 --- a/x/mint/common_test.go +++ b/x/mint/common_test.go @@ -11,7 +11,6 @@ import ( "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - // banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" diff --git a/x/xion/client/cli/query.go b/x/xion/client/cli/query.go index 06734238..0fefc5e4 100644 --- a/x/xion/client/cli/query.go +++ b/x/xion/client/cli/query.go @@ -23,6 +23,7 @@ func GetQueryCmd() *cobra.Command { cmd.AddCommand(CmdWebAuthNVerifyRegister()) cmd.AddCommand(CmdWebAuthNVerifyAuthenticate()) + cmd.AddCommand(CmdPlatformFee()) // this line is used by starport scaffolding # 1 diff --git a/x/xion/client/cli/query_platform_fee.go b/x/xion/client/cli/query_platform_fee.go new file mode 100644 index 00000000..062d312c --- /dev/null +++ b/x/xion/client/cli/query_platform_fee.go @@ -0,0 +1,38 @@ +package cli + +import ( + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + + "github.com/burnt-labs/xion/x/xion/types" +) + +func CmdPlatformFee() *cobra.Command { + cmd := &cobra.Command{ + Use: "platform-fee", + Short: "Get Platform Fee", + RunE: func(cmd *cobra.Command, _ []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryPlatformPercentageRequest{} + + res, err := queryClient.PlatformPercentage(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/xion/keeper/keeper.go b/x/xion/keeper/keeper.go index 46b92fce..e63d1faf 100644 --- a/x/xion/keeper/keeper.go +++ b/x/xion/keeper/keeper.go @@ -1,6 +1,8 @@ package keeper import ( + "context" + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" "cosmossdk.io/log" @@ -74,3 +76,10 @@ func (k Keeper) OverwritePlatformPercentage(ctx sdktypes.Context, percentage uin func (k Keeper) GetAuthority() string { return k.authority } + +// PlatformPercentage implements types.QueryServer. +func (k Keeper) PlatformPercentage(ctx context.Context, _ *types.QueryPlatformPercentageRequest) (*types.QueryPlatformPercentageResponse, error) { + sdkCtx := sdktypes.UnwrapSDKContext(ctx) + percentage := k.GetPlatformPercentage(sdkCtx).Uint64() + return &types.QueryPlatformPercentageResponse{PlatformPercentage: percentage}, nil +} diff --git a/x/xion/types/query.pb.go b/x/xion/types/query.pb.go index 8d9c3584..51e091ac 100644 --- a/x/xion/types/query.pb.go +++ b/x/xion/types/query.pb.go @@ -255,39 +255,125 @@ func (m *QueryWebAuthNVerifyAuthenticateResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryWebAuthNVerifyAuthenticateResponse proto.InternalMessageInfo +type QueryPlatformPercentageRequest struct { +} + +func (m *QueryPlatformPercentageRequest) Reset() { *m = QueryPlatformPercentageRequest{} } +func (m *QueryPlatformPercentageRequest) String() string { return proto.CompactTextString(m) } +func (*QueryPlatformPercentageRequest) ProtoMessage() {} +func (*QueryPlatformPercentageRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2d6eabf4b8b83bc3, []int{4} +} +func (m *QueryPlatformPercentageRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryPlatformPercentageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryPlatformPercentageRequest.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 *QueryPlatformPercentageRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryPlatformPercentageRequest.Merge(m, src) +} +func (m *QueryPlatformPercentageRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryPlatformPercentageRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryPlatformPercentageRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryPlatformPercentageRequest proto.InternalMessageInfo + +type QueryPlatformPercentageResponse struct { + PlatformPercentage uint64 `protobuf:"varint,1,opt,name=platform_percentage,json=platformPercentage,proto3" json:"platform_percentage,omitempty"` +} + +func (m *QueryPlatformPercentageResponse) Reset() { *m = QueryPlatformPercentageResponse{} } +func (m *QueryPlatformPercentageResponse) String() string { return proto.CompactTextString(m) } +func (*QueryPlatformPercentageResponse) ProtoMessage() {} +func (*QueryPlatformPercentageResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2d6eabf4b8b83bc3, []int{5} +} +func (m *QueryPlatformPercentageResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryPlatformPercentageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryPlatformPercentageResponse.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 *QueryPlatformPercentageResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryPlatformPercentageResponse.Merge(m, src) +} +func (m *QueryPlatformPercentageResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryPlatformPercentageResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryPlatformPercentageResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryPlatformPercentageResponse proto.InternalMessageInfo + +func (m *QueryPlatformPercentageResponse) GetPlatformPercentage() uint64 { + if m != nil { + return m.PlatformPercentage + } + return 0 +} + func init() { proto.RegisterType((*QueryWebAuthNVerifyRegisterRequest)(nil), "xion.v1.QueryWebAuthNVerifyRegisterRequest") proto.RegisterType((*QueryWebAuthNVerifyRegisterResponse)(nil), "xion.v1.QueryWebAuthNVerifyRegisterResponse") proto.RegisterType((*QueryWebAuthNVerifyAuthenticateRequest)(nil), "xion.v1.QueryWebAuthNVerifyAuthenticateRequest") proto.RegisterType((*QueryWebAuthNVerifyAuthenticateResponse)(nil), "xion.v1.QueryWebAuthNVerifyAuthenticateResponse") + proto.RegisterType((*QueryPlatformPercentageRequest)(nil), "xion.v1.QueryPlatformPercentageRequest") + proto.RegisterType((*QueryPlatformPercentageResponse)(nil), "xion.v1.QueryPlatformPercentageResponse") } func init() { proto.RegisterFile("xion/v1/query.proto", fileDescriptor_2d6eabf4b8b83bc3) } var fileDescriptor_2d6eabf4b8b83bc3 = []byte{ - // 340 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xae, 0xc8, 0xcc, 0xcf, - 0xd3, 0x2f, 0x33, 0xd4, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, - 0x62, 0x07, 0x09, 0xea, 0x95, 0x19, 0x2a, 0x55, 0x71, 0x29, 0x05, 0x82, 0xc4, 0xc3, 0x53, 0x93, - 0x1c, 0x4b, 0x4b, 0x32, 0xfc, 0xc2, 0x52, 0x8b, 0x32, 0xd3, 0x2a, 0x83, 0x52, 0xd3, 0x33, 0x8b, - 0x4b, 0x52, 0x8b, 0x82, 0x52, 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x84, 0x84, 0xb8, 0x58, 0x12, 0x53, - 0x52, 0x8a, 0x24, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0xc0, 0x6c, 0x21, 0x19, 0x2e, 0xce, 0xe4, - 0x8c, 0xc4, 0x9c, 0x9c, 0xd4, 0xbc, 0xf4, 0x54, 0x09, 0x26, 0xb0, 0x04, 0x42, 0x40, 0x88, 0x8f, - 0x8b, 0xa9, 0xa8, 0x40, 0x82, 0x19, 0x2c, 0xcc, 0x54, 0x54, 0x00, 0x32, 0x21, 0x25, 0xb1, 0x24, - 0x51, 0x82, 0x45, 0x81, 0x51, 0x83, 0x27, 0x08, 0xcc, 0x56, 0x72, 0xe5, 0x52, 0xc6, 0x6b, 0x77, - 0x71, 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0x90, 0x1c, 0x17, 0x57, 0x72, 0x51, 0x6a, 0x4a, 0x6a, 0x5e, - 0x49, 0x66, 0x62, 0x0e, 0xd8, 0x09, 0x3c, 0x41, 0x48, 0x22, 0x4a, 0xf3, 0x18, 0xb9, 0xd4, 0xb0, - 0x98, 0x03, 0x62, 0x82, 0x54, 0x24, 0x27, 0x96, 0xa4, 0x52, 0xcf, 0x1f, 0xa8, 0x8e, 0x61, 0x41, - 0x77, 0x0c, 0xdc, 0x9f, 0xac, 0x48, 0xfe, 0xd4, 0xe4, 0x52, 0x27, 0xe8, 0x3e, 0x88, 0x5f, 0x8d, - 0x9a, 0x98, 0xb8, 0x58, 0xc1, 0x6a, 0x85, 0x4a, 0xb9, 0xc4, 0xb0, 0x87, 0x8b, 0x90, 0xb6, 0x1e, - 0x34, 0xf2, 0xf4, 0x08, 0xc7, 0x9c, 0x94, 0x0e, 0x71, 0x8a, 0x21, 0xd6, 0x2b, 0x31, 0x08, 0x35, - 0x32, 0x72, 0x49, 0xe1, 0x76, 0xa7, 0x90, 0x3e, 0x3e, 0xe3, 0xb0, 0x84, 0xb8, 0x94, 0x01, 0xf1, - 0x1a, 0x60, 0x6e, 0x70, 0x72, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, - 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, - 0xf5, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xa4, 0xd2, 0xa2, 0xbc, - 0x12, 0xdd, 0x9c, 0xc4, 0xa4, 0x62, 0x7d, 0x70, 0x0a, 0xaf, 0x80, 0x50, 0x25, 0x95, 0x05, 0xa9, - 0xc5, 0x49, 0x6c, 0xe0, 0x64, 0x6e, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xcd, 0xd9, 0x5e, 0xff, - 0xfd, 0x02, 0x00, 0x00, + // 404 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0xcd, 0xca, 0xd3, 0x40, + 0x14, 0xcd, 0xc4, 0x7c, 0xca, 0x77, 0xf9, 0x70, 0x31, 0x1f, 0x48, 0x08, 0x32, 0x96, 0x08, 0xb6, + 0xa2, 0x26, 0x56, 0x9f, 0xa0, 0x82, 0x5b, 0xa9, 0x59, 0x28, 0xb8, 0x91, 0x49, 0x72, 0x9b, 0x06, + 0xd2, 0x64, 0x3a, 0x99, 0x94, 0xd6, 0x9d, 0x6f, 0xe0, 0x13, 0xf8, 0x3c, 0x2e, 0xbb, 0x74, 0x29, + 0xed, 0xda, 0x77, 0x90, 0x4c, 0xd3, 0xda, 0xda, 0xdf, 0x85, 0xab, 0x5c, 0xce, 0x3d, 0x39, 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, 0x2b, 0x9a, 0xee, 0x67, 0xb1, 0x69, 0xeb, 0xd0, 0x56, 0x40, + 0xc5, 0xde, 0x8f, 0xaf, 0x7e, 0x9b, 0x70, 0xa5, 0x45, 0x69, 0x05, 0x0f, 0x0e, 0x6f, 0x83, 0x3e, + 0xf3, 0x9a, 0x2b, 0xe3, 0x9d, 0xbf, 0x2f, 0xce, 0xf3, 0xcb, 0xc8, 0x4d, 0x68, 0x83, 0x7e, 0x25, + 0xe0, 0x1c, 0x9f, 0x0e, 0xf5, 0x4f, 0xc9, 0x1d, 0xd8, 0xb3, 0xf3, 0xf2, 0xf2, 0x1f, 0x36, 0x1e, + 0x52, 0xa0, 0xfb, 0x33, 0xa5, 0xed, 0x5d, 0xa5, 0xa3, 0x7b, 0x71, 0x3a, 0xe7, 0x89, 0xeb, 0xa3, + 0xde, 0xf4, 0x7e, 0x2c, 0x18, 0x99, 0x2f, 0x18, 0xf9, 0xb5, 0x60, 0xe4, 0xdb, 0x92, 0x19, 0xf3, + 0x25, 0x33, 0x7e, 0x2e, 0x99, 0xf1, 0xa9, 0x9d, 0xa4, 0x6a, 0x58, 0x85, 0x5e, 0x54, 0x8c, 0xfc, + 0xb0, 0x92, 0xb9, 0x7a, 0x91, 0xf1, 0xb0, 0xf4, 0xf5, 0x13, 0x9e, 0xae, 0x3e, 0x6a, 0x26, 0xb0, + 0x0c, 0xef, 0xea, 0x77, 0xfc, 0xfa, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x48, 0xf8, 0xb9, 0x62, + 0xde, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -304,6 +390,7 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { WebAuthNVerifyRegister(ctx context.Context, in *QueryWebAuthNVerifyRegisterRequest, opts ...grpc.CallOption) (*QueryWebAuthNVerifyRegisterResponse, error) WebAuthNVerifyAuthenticate(ctx context.Context, in *QueryWebAuthNVerifyAuthenticateRequest, opts ...grpc.CallOption) (*QueryWebAuthNVerifyAuthenticateResponse, error) + PlatformPercentage(ctx context.Context, in *QueryPlatformPercentageRequest, opts ...grpc.CallOption) (*QueryPlatformPercentageResponse, error) } type queryClient struct { @@ -332,10 +419,20 @@ func (c *queryClient) WebAuthNVerifyAuthenticate(ctx context.Context, in *QueryW return out, nil } +func (c *queryClient) PlatformPercentage(ctx context.Context, in *QueryPlatformPercentageRequest, opts ...grpc.CallOption) (*QueryPlatformPercentageResponse, error) { + out := new(QueryPlatformPercentageResponse) + err := c.cc.Invoke(ctx, "/xion.v1.Query/PlatformPercentage", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { WebAuthNVerifyRegister(context.Context, *QueryWebAuthNVerifyRegisterRequest) (*QueryWebAuthNVerifyRegisterResponse, error) WebAuthNVerifyAuthenticate(context.Context, *QueryWebAuthNVerifyAuthenticateRequest) (*QueryWebAuthNVerifyAuthenticateResponse, error) + PlatformPercentage(context.Context, *QueryPlatformPercentageRequest) (*QueryPlatformPercentageResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -348,6 +445,9 @@ func (*UnimplementedQueryServer) WebAuthNVerifyRegister(ctx context.Context, req func (*UnimplementedQueryServer) WebAuthNVerifyAuthenticate(ctx context.Context, req *QueryWebAuthNVerifyAuthenticateRequest) (*QueryWebAuthNVerifyAuthenticateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method WebAuthNVerifyAuthenticate not implemented") } +func (*UnimplementedQueryServer) PlatformPercentage(ctx context.Context, req *QueryPlatformPercentageRequest) (*QueryPlatformPercentageResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PlatformPercentage not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -389,6 +489,24 @@ func _Query_WebAuthNVerifyAuthenticate_Handler(srv interface{}, ctx context.Cont return interceptor(ctx, in, info, handler) } +func _Query_PlatformPercentage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryPlatformPercentageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).PlatformPercentage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/xion.v1.Query/PlatformPercentage", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).PlatformPercentage(ctx, req.(*QueryPlatformPercentageRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "xion.v1.Query", HandlerType: (*QueryServer)(nil), @@ -401,6 +519,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "WebAuthNVerifyAuthenticate", Handler: _Query_WebAuthNVerifyAuthenticate_Handler, }, + { + MethodName: "PlatformPercentage", + Handler: _Query_PlatformPercentage_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "xion/v1/query.proto", @@ -568,6 +690,57 @@ func (m *QueryWebAuthNVerifyAuthenticateResponse) MarshalToSizedBuffer(dAtA []by return len(dAtA) - i, nil } +func (m *QueryPlatformPercentageRequest) 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 *QueryPlatformPercentageRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPlatformPercentageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryPlatformPercentageResponse) 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 *QueryPlatformPercentageResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPlatformPercentageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PlatformPercentage != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.PlatformPercentage)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -655,6 +828,27 @@ func (m *QueryWebAuthNVerifyAuthenticateResponse) Size() (n int) { return n } +func (m *QueryPlatformPercentageRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryPlatformPercentageResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PlatformPercentage != 0 { + n += 1 + sovQuery(uint64(m.PlatformPercentage)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1189,6 +1383,125 @@ func (m *QueryWebAuthNVerifyAuthenticateResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryPlatformPercentageRequest) 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: QueryPlatformPercentageRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryPlatformPercentageRequest: 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 *QueryPlatformPercentageResponse) 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: QueryPlatformPercentageResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryPlatformPercentageResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PlatformPercentage", wireType) + } + m.PlatformPercentage = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PlatformPercentage |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0