From efccccc9426ae348b882dfaf9ab67c213d4b4810 Mon Sep 17 00:00:00 2001 From: godismercilex <98415576+godismercilex@users.noreply.github.com> Date: Mon, 23 May 2022 16:44:43 +0200 Subject: [PATCH] [incentivization] add: query server (#464) * add: query server * chore: lint * chore: cleanup UTC times Co-authored-by: fdymylja Co-authored-by: Walter White <101130700+NibiruHeisenberg@users.noreply.github.com> --- .../incentivization/v1/incentivization.proto | 24 + x/dex/types/genesis.pb.go | 5 +- x/dex/types/params.pb.go | 7 +- x/dex/types/pool.pb.go | 7 +- x/dex/types/query.pb.go | 7 +- x/dex/types/tx.pb.go | 7 +- x/epochs/types/genesis.pb.go | 9 +- x/epochs/types/query.pb.go | 7 +- x/incentivization/keeper/servers.go | 36 +- x/incentivization/keeper/servers_test.go | 56 + x/incentivization/keeper/state.go | 14 +- x/incentivization/types/incentivization.pb.go | 1040 +++++++++++++++-- .../types/incentivization.pb.gw.go | 214 ++++ x/lockup/types/genesis.pb.go | 5 +- x/lockup/types/lock.pb.go | 9 +- x/lockup/types/query.pb.go | 7 +- x/lockup/types/tx.pb.go | 9 +- x/perp/types/query.pb.go | 7 +- x/perp/types/state.pb.go | 7 +- x/perp/types/tx.pb.go | 7 +- x/pricefeed/types/genesis.pb.go | 5 +- x/pricefeed/types/params.pb.go | 9 +- x/pricefeed/types/query.pb.go | 9 +- x/pricefeed/types/tx.pb.go | 9 +- x/stablecoin/types/genesis.pb.go | 7 +- x/stablecoin/types/params.pb.go | 5 +- x/stablecoin/types/query.pb.go | 7 +- x/stablecoin/types/tx.pb.go | 7 +- x/testutil/cli/network_test.go | 3 +- x/vpool/types/vpool.pb.go | 7 +- 30 files changed, 1371 insertions(+), 181 deletions(-) create mode 100644 x/incentivization/keeper/servers_test.go diff --git a/proto/incentivization/v1/incentivization.proto b/proto/incentivization/v1/incentivization.proto index 01df35f1d..f22fa1a90 100644 --- a/proto/incentivization/v1/incentivization.proto +++ b/proto/incentivization/v1/incentivization.proto @@ -9,6 +9,7 @@ import "google/protobuf/duration.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; import "cosmos/base/v1beta1/coin.proto"; @@ -95,5 +96,28 @@ message GenesisState { } service Query { + rpc IncentivizationProgram(QueryIncentivizationProgramRequest) returns (QueryIncentivizationProgramResponse){ + option (google.api.http).get = "/nibiru/incentivization/v1/incentivization_program"; + }; + rpc IncentivizationPrograms(QueryIncentivizationProgramsRequest) returns (QueryIncentivizationProgramsResponse) { + option (google.api.http).get = "/nibiru/incentivization/v1/incentivization_programs"; + } +} + +message QueryIncentivizationProgramRequest { + uint64 id = 1; +} + +message QueryIncentivizationProgramResponse { + IncentivizationProgram incentivization_program = 1; +} + +message QueryIncentivizationProgramsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryIncentivizationProgramsResponse { + repeated IncentivizationProgram incentivization_programs = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } \ No newline at end of file diff --git a/x/dex/types/genesis.pb.go b/x/dex/types/genesis.pb.go index c3f8181a2..49fa399d2 100644 --- a/x/dex/types/genesis.pb.go +++ b/x/dex/types/genesis.pb.go @@ -5,11 +5,12 @@ package types import ( fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" io "io" math "math" math_bits "math/bits" + + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dex/types/params.pb.go b/x/dex/types/params.pb.go index 3eb27cbdf..53bb25ef3 100644 --- a/x/dex/types/params.pb.go +++ b/x/dex/types/params.pb.go @@ -5,14 +5,15 @@ package types import ( fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" _ "github.com/regen-network/cosmos-proto" - io "io" - math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dex/types/pool.pb.go b/x/dex/types/pool.pb.go index 43ae5911f..a962a7cb4 100644 --- a/x/dex/types/pool.pb.go +++ b/x/dex/types/pool.pb.go @@ -5,14 +5,15 @@ package types import ( fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" _ "github.com/regen-network/cosmos-proto" - io "io" - math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dex/types/query.pb.go b/x/dex/types/query.pb.go index 8e65c04e0..e54b04472 100644 --- a/x/dex/types/query.pb.go +++ b/x/dex/types/query.pb.go @@ -6,6 +6,10 @@ package types import ( context "context" fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" @@ -16,9 +20,6 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dex/types/tx.pb.go b/x/dex/types/tx.pb.go index f59bda16d..279c01df9 100644 --- a/x/dex/types/tx.pb.go +++ b/x/dex/types/tx.pb.go @@ -6,6 +6,10 @@ package types import ( context "context" fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" @@ -14,9 +18,6 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/epochs/types/genesis.pb.go b/x/epochs/types/genesis.pb.go index 9af28dee4..9f24ddade 100644 --- a/x/epochs/types/genesis.pb.go +++ b/x/epochs/types/genesis.pb.go @@ -5,15 +5,16 @@ package types import ( fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + time "time" + _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" _ "google.golang.org/protobuf/types/known/durationpb" _ "google.golang.org/protobuf/types/known/timestamppb" - io "io" - math "math" - math_bits "math/bits" - time "time" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/epochs/types/query.pb.go b/x/epochs/types/query.pb.go index 2fa7b3f0e..26db7f8e8 100644 --- a/x/epochs/types/query.pb.go +++ b/x/epochs/types/query.pb.go @@ -6,6 +6,10 @@ package types import ( context "context" fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + _ "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" @@ -14,9 +18,6 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/incentivization/keeper/servers.go b/x/incentivization/keeper/servers.go index f6130351b..434b344fd 100644 --- a/x/incentivization/keeper/servers.go +++ b/x/incentivization/keeper/servers.go @@ -3,6 +3,9 @@ package keeper import ( "context" + "github.com/cosmos/cosmos-sdk/store/prefix" + "github.com/cosmos/cosmos-sdk/types/query" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/NibiruChain/nibiru/x/incentivization/types" @@ -69,5 +72,36 @@ func NewQueryServer(k Keeper) types.QueryServer { } type queryServer struct { - Keeper + k Keeper +} + +func (q queryServer) IncentivizationProgram(ctx context.Context, request *types.QueryIncentivizationProgramRequest) (*types.QueryIncentivizationProgramResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + program, err := q.k.IncentivizationProgramsState(sdkCtx).Get(request.Id) + if err != nil { + return nil, err + } + return &types.QueryIncentivizationProgramResponse{IncentivizationProgram: program}, nil +} + +func (q queryServer) IncentivizationPrograms(ctx context.Context, request *types.QueryIncentivizationProgramsRequest) (*types.QueryIncentivizationProgramsResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + store := prefix.NewStore(sdkCtx.KVStore(q.k.storeKey), incentivizationProgramObjectsNamespace) + + var programs []*types.IncentivizationProgram + pageResp, err := query.Paginate(store, request.Pagination, func(key []byte, value []byte) error { + bytes := store.Get(key) + program := new(types.IncentivizationProgram) + q.k.cdc.MustUnmarshal(bytes, program) + programs = append(programs, program) + return nil + }) + if err != nil { + return nil, err + } + + return &types.QueryIncentivizationProgramsResponse{ + IncentivizationPrograms: programs, + Pagination: pageResp, + }, nil } diff --git a/x/incentivization/keeper/servers_test.go b/x/incentivization/keeper/servers_test.go new file mode 100644 index 000000000..771d7d090 --- /dev/null +++ b/x/incentivization/keeper/servers_test.go @@ -0,0 +1,56 @@ +package keeper_test + +import ( + "testing" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + "github.com/NibiruChain/nibiru/x/incentivization/keeper" + "github.com/NibiruChain/nibiru/x/incentivization/types" + "github.com/NibiruChain/nibiru/x/testutil" +) + +func TestQueryServer_IncentivizationProgram(t *testing.T) { + app := testutil.NewTestApp(false) + q := keeper.NewQueryServer(app.IncentivizationKeeper) + ctx := app.NewContext(false, tmproto.Header{Time: time.Now()}) + + // init + program, err := app.IncentivizationKeeper.CreateIncentivizationProgram(ctx, "lp", 24*time.Hour, time.Now().Add(1*time.Second).UTC(), 100) + require.NoError(t, err) + + resp, err := q.IncentivizationProgram(sdk.WrapSDKContext(ctx), &types.QueryIncentivizationProgramRequest{}) + require.NoError(t, err) + require.Equal(t, program, resp.IncentivizationProgram) +} + +func TestQueryServer_IncentivizationPrograms(t *testing.T) { + app := testutil.NewTestApp(false) + q := keeper.NewQueryServer(app.IncentivizationKeeper) + ctx := app.NewContext(false, tmproto.Header{Time: time.Now()}) + + // init + _, err := app.IncentivizationKeeper.CreateIncentivizationProgram(ctx, "lp", 24*time.Hour, time.Now().Add(1*time.Second).UTC(), 100) + require.NoError(t, err) + + program2, err := app.IncentivizationKeeper.CreateIncentivizationProgram(ctx, "lp", 24*time.Hour, time.Now().Add(1*time.Second).UTC(), 100) + require.NoError(t, err) + + program3, err := app.IncentivizationKeeper.CreateIncentivizationProgram(ctx, "lp", 24*time.Hour, time.Now().Add(1*time.Second).UTC(), 100) + require.NoError(t, err) + + // query + resp, err := q.IncentivizationPrograms(sdk.WrapSDKContext(ctx), &types.QueryIncentivizationProgramsRequest{Pagination: &query.PageRequest{ + Offset: 1, + Limit: 2, + }}) + require.NoError(t, err) + + require.Equal(t, []*types.IncentivizationProgram{ + program2, program3, + }, resp.IncentivizationPrograms) +} diff --git a/x/incentivization/keeper/state.go b/x/incentivization/keeper/state.go index 8e9992ab9..e7b70d120 100644 --- a/x/incentivization/keeper/state.go +++ b/x/incentivization/keeper/state.go @@ -13,12 +13,12 @@ const ( ) var ( - incentivizationProgramNamespace = []byte{0x0} - incentivizationProgramIDNamespace = append(incentivizationProgramNamespace, 0x0) - incentivizationProgramIDKey = []byte{0x1} - incentiviationProgramObjectNamespace = append(incentivizationProgramNamespace, 0x1) - incentivizationProgramDenomIndex = append(incentivizationProgramNamespace, 0x2) - incentivizationProgramDenomMap = append(incentivizationProgramNamespace, 0x3) + incentivizationProgramNamespace = []byte{0x0} + incentivizationProgramIDNamespace = append(incentivizationProgramNamespace, 0x0) + incentivizationProgramIDKey = []byte{0x1} + incentivizationProgramObjectsNamespace = append(incentivizationProgramNamespace, 0x1) + incentivizationProgramDenomIndex = append(incentivizationProgramNamespace, 0x2) + incentivizationProgramDenomMap = append(incentivizationProgramNamespace, 0x3) ) func (k Keeper) IncentivizationProgramsState(ctx sdk.Context) IncentivizationProgramState { @@ -31,7 +31,7 @@ func newIncentivizationProgramState(ctx sdk.Context, key sdk.StoreKey, cdc codec cdc: cdc, ctx: ctx, programID: prefix.NewStore(store, incentivizationProgramIDNamespace), - incentivizationPrograms: prefix.NewStore(store, incentiviationProgramObjectNamespace), + incentivizationPrograms: prefix.NewStore(store, incentivizationProgramObjectsNamespace), denomToIncentivizationProgramIndex: prefix.NewStore(store, incentivizationProgramDenomIndex), denomMap: prefix.NewStore(store, incentivizationProgramDenomMap), } diff --git a/x/incentivization/types/incentivization.pb.go b/x/incentivization/types/incentivization.pb.go index 5d96446e9..328ce17e8 100644 --- a/x/incentivization/types/incentivization.pb.go +++ b/x/incentivization/types/incentivization.pb.go @@ -6,8 +6,14 @@ package types import ( context "context" fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + time "time" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" + query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" @@ -18,10 +24,6 @@ import ( status "google.golang.org/grpc/status" _ "google.golang.org/protobuf/types/known/durationpb" _ "google.golang.org/protobuf/types/known/timestamppb" - io "io" - math "math" - math_bits "math/bits" - time "time" ) // Reference imports to suppress errors if they are not otherwise used. @@ -416,6 +418,190 @@ func (m *GenesisState) GetIncentivizationPrograms() []*IncentivizationProgram { return nil } +type QueryIncentivizationProgramRequest struct { + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *QueryIncentivizationProgramRequest) Reset() { *m = QueryIncentivizationProgramRequest{} } +func (m *QueryIncentivizationProgramRequest) String() string { return proto.CompactTextString(m) } +func (*QueryIncentivizationProgramRequest) ProtoMessage() {} +func (*QueryIncentivizationProgramRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_cd0a6e6c5ab9e048, []int{6} +} +func (m *QueryIncentivizationProgramRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryIncentivizationProgramRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryIncentivizationProgramRequest.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 *QueryIncentivizationProgramRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryIncentivizationProgramRequest.Merge(m, src) +} +func (m *QueryIncentivizationProgramRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryIncentivizationProgramRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryIncentivizationProgramRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryIncentivizationProgramRequest proto.InternalMessageInfo + +func (m *QueryIncentivizationProgramRequest) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +type QueryIncentivizationProgramResponse struct { + IncentivizationProgram *IncentivizationProgram `protobuf:"bytes,1,opt,name=incentivization_program,json=incentivizationProgram,proto3" json:"incentivization_program,omitempty"` +} + +func (m *QueryIncentivizationProgramResponse) Reset() { *m = QueryIncentivizationProgramResponse{} } +func (m *QueryIncentivizationProgramResponse) String() string { return proto.CompactTextString(m) } +func (*QueryIncentivizationProgramResponse) ProtoMessage() {} +func (*QueryIncentivizationProgramResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_cd0a6e6c5ab9e048, []int{7} +} +func (m *QueryIncentivizationProgramResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryIncentivizationProgramResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryIncentivizationProgramResponse.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 *QueryIncentivizationProgramResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryIncentivizationProgramResponse.Merge(m, src) +} +func (m *QueryIncentivizationProgramResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryIncentivizationProgramResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryIncentivizationProgramResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryIncentivizationProgramResponse proto.InternalMessageInfo + +func (m *QueryIncentivizationProgramResponse) GetIncentivizationProgram() *IncentivizationProgram { + if m != nil { + return m.IncentivizationProgram + } + return nil +} + +type QueryIncentivizationProgramsRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryIncentivizationProgramsRequest) Reset() { *m = QueryIncentivizationProgramsRequest{} } +func (m *QueryIncentivizationProgramsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryIncentivizationProgramsRequest) ProtoMessage() {} +func (*QueryIncentivizationProgramsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_cd0a6e6c5ab9e048, []int{8} +} +func (m *QueryIncentivizationProgramsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryIncentivizationProgramsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryIncentivizationProgramsRequest.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 *QueryIncentivizationProgramsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryIncentivizationProgramsRequest.Merge(m, src) +} +func (m *QueryIncentivizationProgramsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryIncentivizationProgramsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryIncentivizationProgramsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryIncentivizationProgramsRequest proto.InternalMessageInfo + +func (m *QueryIncentivizationProgramsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryIncentivizationProgramsResponse struct { + IncentivizationPrograms []*IncentivizationProgram `protobuf:"bytes,1,rep,name=incentivization_programs,json=incentivizationPrograms,proto3" json:"incentivization_programs,omitempty"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryIncentivizationProgramsResponse) Reset() { *m = QueryIncentivizationProgramsResponse{} } +func (m *QueryIncentivizationProgramsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryIncentivizationProgramsResponse) ProtoMessage() {} +func (*QueryIncentivizationProgramsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_cd0a6e6c5ab9e048, []int{9} +} +func (m *QueryIncentivizationProgramsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryIncentivizationProgramsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryIncentivizationProgramsResponse.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 *QueryIncentivizationProgramsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryIncentivizationProgramsResponse.Merge(m, src) +} +func (m *QueryIncentivizationProgramsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryIncentivizationProgramsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryIncentivizationProgramsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryIncentivizationProgramsResponse proto.InternalMessageInfo + +func (m *QueryIncentivizationProgramsResponse) GetIncentivizationPrograms() []*IncentivizationProgram { + if m != nil { + return m.IncentivizationPrograms + } + return nil +} + +func (m *QueryIncentivizationProgramsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { proto.RegisterType((*MsgCreateIncentivizationProgram)(nil), "nibiru.incentivization.v1.MsgCreateIncentivizationProgram") proto.RegisterType((*MsgCreateIncentivizationProgramResponse)(nil), "nibiru.incentivization.v1.MsgCreateIncentivizationProgramResponse") @@ -423,6 +609,10 @@ func init() { proto.RegisterType((*MsgFundIncentivizationProgramResponse)(nil), "nibiru.incentivization.v1.MsgFundIncentivizationProgramResponse") proto.RegisterType((*IncentivizationProgram)(nil), "nibiru.incentivization.v1.IncentivizationProgram") proto.RegisterType((*GenesisState)(nil), "nibiru.incentivization.v1.GenesisState") + proto.RegisterType((*QueryIncentivizationProgramRequest)(nil), "nibiru.incentivization.v1.QueryIncentivizationProgramRequest") + proto.RegisterType((*QueryIncentivizationProgramResponse)(nil), "nibiru.incentivization.v1.QueryIncentivizationProgramResponse") + proto.RegisterType((*QueryIncentivizationProgramsRequest)(nil), "nibiru.incentivization.v1.QueryIncentivizationProgramsRequest") + proto.RegisterType((*QueryIncentivizationProgramsResponse)(nil), "nibiru.incentivization.v1.QueryIncentivizationProgramsResponse") } func init() { @@ -430,53 +620,64 @@ func init() { } var fileDescriptor_cd0a6e6c5ab9e048 = []byte{ - // 727 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x4d, 0x6f, 0xd3, 0x3e, - 0x1c, 0x6e, 0x9a, 0x76, 0x2f, 0xfe, 0x6f, 0xfb, 0x43, 0x40, 0x23, 0x8b, 0xb6, 0xb4, 0x8a, 0x18, - 0x2b, 0x07, 0x12, 0x3a, 0x84, 0x84, 0xb8, 0x00, 0xed, 0x78, 0x99, 0xc4, 0x18, 0x64, 0x9c, 0xb8, - 0x44, 0x6e, 0xe2, 0x65, 0xd6, 0x1a, 0x3b, 0x8a, 0x9d, 0xc2, 0x10, 0x27, 0xbe, 0x00, 0x93, 0xb8, - 0xf0, 0x19, 0x76, 0xe1, 0x1b, 0x70, 0x44, 0x3b, 0x4e, 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, - 0x4e, 0x9b, 0xba, 0xdb, 0x71, 0xe8, 0xe4, 0x3a, 0x54, 0xb9, 0x2a, 0xd5, 0xfe, 0x5b, 0x9e, 0x33, - 0xd3, 0x96, 0xcd, 0x5c, 0xa8, 0xb9, 0x92, 0x2d, 0x68, 0x94, 0x3e, 0x1d, 0x56, 0x24, 0xfb, 0x62, - 0x80, 0xc9, 0x53, 0x01, 0xcd, 0x27, 0x94, 0x7b, 0x00, 0x30, 0x0e, 0x23, 0xee, 0x24, 0xa6, 0xa9, - 0x25, 0xc1, 0xa3, 0x9d, 0xe2, 0x79, 0x99, 0x3b, 0xda, 0x28, 0xed, 0x26, 0x44, 0x93, 0x02, 0x93, - 0x54, 0x13, 0x11, 0x28, 0xa4, 0xee, 0x16, 0x53, 0xcb, 0x55, 0xa9, 0x26, 0xdb, 0xd9, 0x48, 0x09, - 0xc1, 0x34, 0x26, 0x98, 0x63, 0xd8, 0x76, 0x36, 0x63, 0xe2, 0x31, 0x75, 0xbc, 0x2a, 0x8b, 0x1e, - 0x53, 0xe3, 0xcc, 0xc4, 0x38, 0x33, 0x33, 0xce, 0x6c, 0x52, 0x4c, 0x1a, 0x37, 0xf7, 0x7f, 0x54, - 0x0a, 0x7b, 0x87, 0x95, 0x9a, 0x8f, 0xf9, 0x56, 0xdc, 0x32, 0x5d, 0x1a, 0x58, 0x99, 0xcb, 0xe9, - 0xe7, 0x06, 0xf3, 0xb6, 0x2d, 0xbe, 0x13, 0x22, 0x26, 0x00, 0xcc, 0x9e, 0xca, 0x76, 0x78, 0x94, - 0x6c, 0x60, 0x3c, 0x01, 0x4b, 0x23, 0x1c, 0xb7, 0x11, 0x0b, 0x29, 0x61, 0x48, 0x59, 0x00, 0x20, - 0x4c, 0x4b, 0x0e, 0xf6, 0x84, 0xfb, 0x25, 0x7b, 0x32, 0xab, 0xac, 0x7a, 0xc6, 0x9e, 0x04, 0x16, - 0xd6, 0x98, 0x9f, 0xd0, 0xfe, 0xe5, 0xd1, 0xcd,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0xca, 0xd5, - 0xff, 0x84, 0x5b, 0xae, 0x60, 0x51, 0xbe, 0x48, 0x40, 0x1b, 0x72, 0xa7, 0xee, 0x0c, 0x6f, 0x65, - 0x30, 0x52, 0xbb, 0x7f, 0x5e, 0x64, 0x57, 0xc2, 0x55, 0x21, 0x41, 0x37, 0xe6, 0x07, 0x49, 0x48, - 0xee, 0xda, 0xf2, 0x38, 0x28, 0xbf, 0x88, 0x51, 0xb4, 0xd3, 0x58, 0xdf, 0x3f, 0xd2, 0xa5, 0x83, - 0x23, 0x5d, 0xfa, 0x79, 0xa4, 0x4b, 0xbb, 0xc7, 0x7a, 0xe1, 0xe0, 0x58, 0x2f, 0x7c, 0x3f, 0xd6, - 0x0b, 0xaf, 0x6e, 0x9f, 0xb8, 0xbe, 0xcf, 0x04, 0x55, 0x73, 0x0b, 0x62, 0x92, 0xd3, 0xbe, 0x39, - 0x45, 0x2c, 0x6e, 0x74, 0x6b, 0x4c, 0x44, 0xf2, 0xd6, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x25, - 0xa5, 0x6d, 0xb4, 0x11, 0x07, 0x00, 0x00, + // 904 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x41, 0x8f, 0xdb, 0x44, + 0x14, 0xde, 0x49, 0xb2, 0xdb, 0xee, 0xd0, 0x16, 0x18, 0xd0, 0xae, 0xd7, 0xda, 0x3a, 0x91, 0x69, + 0xbb, 0x01, 0x09, 0x9b, 0x6c, 0x5b, 0x09, 0x15, 0x41, 0x21, 0x5b, 0x5a, 0x2a, 0xb1, 0xb4, 0xb8, + 0x9c, 0xb8, 0x58, 0x13, 0x7b, 0xea, 0x1d, 0x1a, 0xcf, 0xb8, 0x9e, 0x71, 0xa0, 0x88, 0x13, 0x7f, + 0x80, 0x22, 0x2e, 0xfc, 0x86, 0x5e, 0x38, 0x72, 0xe3, 0x88, 0x7a, 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0x6d, 0x57, 0x31, 0x39, 0xfc, 0x9d, 0x56, 0x76, 0x03, 0xfa, 0x0d, + 0xc0, 0xf5, 0x8a, 0x66, 0x42, 0x0b, 0xc6, 0x55, 0x76, 0xbd, 0x79, 0x75, 0x61, 0xbc, 0x26, 0xf6, + 0x8e, 0x22, 0x76, 0x19, 0x5d, 0x3c, 0x3e, 0x31, 0xd1, 0xbf, 0xf5, 0x78, 0xdf, 0x02, 0x4f, 0xf6, + 0x2d, 0xf0, 0xd7, 0xbe, 0x05, 0x1e, 0x1e, 0x58, 0x4b, 0x4f, 0x0e, 0xac, 0xa5, 0xdf, 0x0f, 0xac, + 0xa5, 0xcf, 0x2f, 0x4f, 0x3c, 0xc4, 0x9f, 0x28, 0xc7, 0x3b, 0x7b, 0x98, 0xb2, 0xf2, 0x92, 0xaf, + 0x0e, 0x5d, 0xa3, 0xde, 0xe6, 0xc1, 0x8a, 0x7a, 0x5c, 0x2e, 0xfe, 0x1b, 0x00, 0x00, 0xff, 0xff, + 0x0a, 0x7f, 0xa0, 0x3b, 0x07, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -603,6 +804,8 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ // // 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 { + IncentivizationProgram(ctx context.Context, in *QueryIncentivizationProgramRequest, opts ...grpc.CallOption) (*QueryIncentivizationProgramResponse, error) + IncentivizationPrograms(ctx context.Context, in *QueryIncentivizationProgramsRequest, opts ...grpc.CallOption) (*QueryIncentivizationProgramsResponse, error) } type queryClient struct { @@ -613,24 +816,96 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } +func (c *queryClient) IncentivizationProgram(ctx context.Context, in *QueryIncentivizationProgramRequest, opts ...grpc.CallOption) (*QueryIncentivizationProgramResponse, error) { + out := new(QueryIncentivizationProgramResponse) + err := c.cc.Invoke(ctx, "/nibiru.incentivization.v1.Query/IncentivizationProgram", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) IncentivizationPrograms(ctx context.Context, in *QueryIncentivizationProgramsRequest, opts ...grpc.CallOption) (*QueryIncentivizationProgramsResponse, error) { + out := new(QueryIncentivizationProgramsResponse) + err := c.cc.Invoke(ctx, "/nibiru.incentivization.v1.Query/IncentivizationPrograms", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { + IncentivizationProgram(context.Context, *QueryIncentivizationProgramRequest) (*QueryIncentivizationProgramResponse, error) + IncentivizationPrograms(context.Context, *QueryIncentivizationProgramsRequest) (*QueryIncentivizationProgramsResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. type UnimplementedQueryServer struct { } +func (*UnimplementedQueryServer) IncentivizationProgram(ctx context.Context, req *QueryIncentivizationProgramRequest) (*QueryIncentivizationProgramResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IncentivizationProgram not implemented") +} +func (*UnimplementedQueryServer) IncentivizationPrograms(ctx context.Context, req *QueryIncentivizationProgramsRequest) (*QueryIncentivizationProgramsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IncentivizationPrograms not implemented") +} + func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) } +func _Query_IncentivizationProgram_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryIncentivizationProgramRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).IncentivizationProgram(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/nibiru.incentivization.v1.Query/IncentivizationProgram", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).IncentivizationProgram(ctx, req.(*QueryIncentivizationProgramRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_IncentivizationPrograms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryIncentivizationProgramsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).IncentivizationPrograms(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/nibiru.incentivization.v1.Query/IncentivizationPrograms", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).IncentivizationPrograms(ctx, req.(*QueryIncentivizationProgramsRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "nibiru.incentivization.v1.Query", HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{}, - Metadata: "incentivization/v1/incentivization.proto", + Methods: []grpc.MethodDesc{ + { + MethodName: "IncentivizationProgram", + Handler: _Query_IncentivizationProgram_Handler, + }, + { + MethodName: "IncentivizationPrograms", + Handler: _Query_IncentivizationPrograms_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "incentivization/v1/incentivization.proto", } func (m *MsgCreateIncentivizationProgram) Marshal() (dAtA []byte, err error) { @@ -909,65 +1184,212 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func encodeVarintIncentivization(dAtA []byte, offset int, v uint64) int { - offset -= sovIncentivization(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *QueryIncentivizationProgramRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *MsgCreateIncentivizationProgram) Size() (n int) { - if m == nil { - return 0 - } + +func (m *QueryIncentivizationProgramRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryIncentivizationProgramRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovIncentivization(uint64(l)) - } - l = len(m.LpDenom) - if l > 0 { - n += 1 + l + sovIncentivization(uint64(l)) - } - if m.MinLockupDuration != nil { - l = github_com_gogo_protobuf_types.SizeOfStdDuration(*m.MinLockupDuration) - n += 1 + l + sovIncentivization(uint64(l)) - } - if m.StartTime != nil { - l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.StartTime) - n += 1 + l + sovIncentivization(uint64(l)) - } - if m.Epochs != 0 { - n += 1 + sovIncentivization(uint64(m.Epochs)) - } - if len(m.InitialFunds) > 0 { - for _, e := range m.InitialFunds { - l = e.Size() - n += 1 + l + sovIncentivization(uint64(l)) - } + if m.Id != 0 { + i = encodeVarintIncentivization(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 } - return n + return len(dAtA) - i, nil } -func (m *MsgCreateIncentivizationProgramResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryIncentivizationProgramResponse) 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 *QueryIncentivizationProgramResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryIncentivizationProgramResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.ProgramId != 0 { - n += 1 + sovIncentivization(uint64(m.ProgramId)) + if m.IncentivizationProgram != nil { + { + size, err := m.IncentivizationProgram.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintIncentivization(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *MsgFundIncentivizationProgram) Size() (n int) { - if m == nil { +func (m *QueryIncentivizationProgramsRequest) 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 *QueryIncentivizationProgramsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryIncentivizationProgramsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintIncentivization(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryIncentivizationProgramsResponse) 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 *QueryIncentivizationProgramsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryIncentivizationProgramsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintIncentivization(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.IncentivizationPrograms) > 0 { + for iNdEx := len(m.IncentivizationPrograms) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.IncentivizationPrograms[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintIncentivization(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintIncentivization(dAtA []byte, offset int, v uint64) int { + offset -= sovIncentivization(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgCreateIncentivizationProgram) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovIncentivization(uint64(l)) + } + l = len(m.LpDenom) + if l > 0 { + n += 1 + l + sovIncentivization(uint64(l)) + } + if m.MinLockupDuration != nil { + l = github_com_gogo_protobuf_types.SizeOfStdDuration(*m.MinLockupDuration) + n += 1 + l + sovIncentivization(uint64(l)) + } + if m.StartTime != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.StartTime) + n += 1 + l + sovIncentivization(uint64(l)) + } + if m.Epochs != 0 { + n += 1 + sovIncentivization(uint64(m.Epochs)) + } + if len(m.InitialFunds) > 0 { + for _, e := range m.InitialFunds { + l = e.Size() + n += 1 + l + sovIncentivization(uint64(l)) + } + } + return n +} + +func (m *MsgCreateIncentivizationProgramResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProgramId != 0 { + n += 1 + sovIncentivization(uint64(m.ProgramId)) + } + return n +} + +func (m *MsgFundIncentivizationProgram) Size() (n int) { + if m == nil { return 0 } var l int @@ -1039,6 +1461,63 @@ func (m *GenesisState) Size() (n int) { return n } +func (m *QueryIncentivizationProgramRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovIncentivization(uint64(m.Id)) + } + return n +} + +func (m *QueryIncentivizationProgramResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.IncentivizationProgram != nil { + l = m.IncentivizationProgram.Size() + n += 1 + l + sovIncentivization(uint64(l)) + } + return n +} + +func (m *QueryIncentivizationProgramsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovIncentivization(uint64(l)) + } + return n +} + +func (m *QueryIncentivizationProgramsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.IncentivizationPrograms) > 0 { + for _, e := range m.IncentivizationPrograms { + l = e.Size() + n += 1 + l + sovIncentivization(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovIncentivization(uint64(l)) + } + return n +} + func sovIncentivization(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1840,6 +2319,367 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryIncentivizationProgramRequest) 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 ErrIntOverflowIncentivization + } + 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: QueryIncentivizationProgramRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryIncentivizationProgramRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIncentivization + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipIncentivization(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthIncentivization + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryIncentivizationProgramResponse) 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 ErrIntOverflowIncentivization + } + 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: QueryIncentivizationProgramResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryIncentivizationProgramResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IncentivizationProgram", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIncentivization + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthIncentivization + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthIncentivization + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.IncentivizationProgram == nil { + m.IncentivizationProgram = &IncentivizationProgram{} + } + if err := m.IncentivizationProgram.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipIncentivization(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthIncentivization + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryIncentivizationProgramsRequest) 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 ErrIntOverflowIncentivization + } + 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: QueryIncentivizationProgramsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryIncentivizationProgramsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIncentivization + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthIncentivization + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthIncentivization + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipIncentivization(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthIncentivization + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryIncentivizationProgramsResponse) 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 ErrIntOverflowIncentivization + } + 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: QueryIncentivizationProgramsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryIncentivizationProgramsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IncentivizationPrograms", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIncentivization + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthIncentivization + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthIncentivization + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IncentivizationPrograms = append(m.IncentivizationPrograms, &IncentivizationProgram{}) + if err := m.IncentivizationPrograms[len(m.IncentivizationPrograms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowIncentivization + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthIncentivization + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthIncentivization + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipIncentivization(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthIncentivization + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipIncentivization(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/incentivization/types/incentivization.pb.gw.go b/x/incentivization/types/incentivization.pb.gw.go index 9d7df1356..a3fa9fec1 100644 --- a/x/incentivization/types/incentivization.pb.gw.go +++ b/x/incentivization/types/incentivization.pb.gw.go @@ -103,6 +103,78 @@ func local_request_Msg_FundIncentivizationProgram_0(ctx context.Context, marshal } +var ( + filter_Query_IncentivizationProgram_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_IncentivizationProgram_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryIncentivizationProgramRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_IncentivizationProgram_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.IncentivizationProgram(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_IncentivizationProgram_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryIncentivizationProgramRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_IncentivizationProgram_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.IncentivizationProgram(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_IncentivizationPrograms_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_IncentivizationPrograms_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryIncentivizationProgramsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_IncentivizationPrograms_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.IncentivizationPrograms(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_IncentivizationPrograms_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryIncentivizationProgramsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_IncentivizationPrograms_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.IncentivizationPrograms(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". // UnaryRPC :call MsgServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -152,6 +224,55 @@ func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server return nil } +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_IncentivizationProgram_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.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_IncentivizationProgram_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_IncentivizationProgram_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_IncentivizationPrograms_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.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_IncentivizationPrograms_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_IncentivizationPrograms_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + // RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { @@ -244,3 +365,96 @@ var ( forward_Msg_FundIncentivizationProgram_0 = runtime.ForwardResponseMessage ) + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_IncentivizationProgram_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_IncentivizationProgram_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_IncentivizationProgram_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_IncentivizationPrograms_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_IncentivizationPrograms_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_IncentivizationPrograms_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_IncentivizationProgram_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"nibiru", "incentivization", "v1", "incentivization_program"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_IncentivizationPrograms_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"nibiru", "incentivization", "v1", "incentivization_programs"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_IncentivizationProgram_0 = runtime.ForwardResponseMessage + + forward_Query_IncentivizationPrograms_0 = runtime.ForwardResponseMessage +) diff --git a/x/lockup/types/genesis.pb.go b/x/lockup/types/genesis.pb.go index 3985e170b..604009e27 100644 --- a/x/lockup/types/genesis.pb.go +++ b/x/lockup/types/genesis.pb.go @@ -5,11 +5,12 @@ package types import ( fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" io "io" math "math" math_bits "math/bits" + + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/lockup/types/lock.pb.go b/x/lockup/types/lock.pb.go index 306041ac5..7a80e321c 100644 --- a/x/lockup/types/lock.pb.go +++ b/x/lockup/types/lock.pb.go @@ -5,6 +5,11 @@ package types import ( fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + time "time" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" @@ -12,10 +17,6 @@ import ( github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" _ "google.golang.org/protobuf/types/known/durationpb" _ "google.golang.org/protobuf/types/known/timestamppb" - io "io" - math "math" - math_bits "math/bits" - time "time" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/lockup/types/query.pb.go b/x/lockup/types/query.pb.go index 7f7242dd9..c8695662a 100644 --- a/x/lockup/types/query.pb.go +++ b/x/lockup/types/query.pb.go @@ -6,6 +6,10 @@ package types import ( context "context" fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" @@ -16,9 +20,6 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/lockup/types/tx.pb.go b/x/lockup/types/tx.pb.go index 15df61daf..3f8d12432 100644 --- a/x/lockup/types/tx.pb.go +++ b/x/lockup/types/tx.pb.go @@ -6,6 +6,11 @@ package types import ( context "context" fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + time "time" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" @@ -17,10 +22,6 @@ import ( codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" _ "google.golang.org/protobuf/types/known/durationpb" - io "io" - math "math" - math_bits "math/bits" - time "time" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/perp/types/query.pb.go b/x/perp/types/query.pb.go index 543f80867..09b075182 100644 --- a/x/perp/types/query.pb.go +++ b/x/perp/types/query.pb.go @@ -6,6 +6,10 @@ package types import ( context "context" fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" @@ -13,9 +17,6 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/perp/types/state.pb.go b/x/perp/types/state.pb.go index 3d6422396..3dc22308d 100644 --- a/x/perp/types/state.pb.go +++ b/x/perp/types/state.pb.go @@ -5,14 +5,15 @@ package types import ( fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" _ "github.com/regen-network/cosmos-proto" - io "io" - math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/perp/types/tx.pb.go b/x/perp/types/tx.pb.go index 584e6b674..5e9f3fb4c 100644 --- a/x/perp/types/tx.pb.go +++ b/x/perp/types/tx.pb.go @@ -6,6 +6,10 @@ package types import ( context "context" fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" @@ -15,9 +19,6 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/pricefeed/types/genesis.pb.go b/x/pricefeed/types/genesis.pb.go index 668f1f27d..3e2155875 100644 --- a/x/pricefeed/types/genesis.pb.go +++ b/x/pricefeed/types/genesis.pb.go @@ -5,11 +5,12 @@ package types import ( fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" io "io" math "math" math_bits "math/bits" + + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/pricefeed/types/params.pb.go b/x/pricefeed/types/params.pb.go index 156fd0ade..64f225491 100644 --- a/x/pricefeed/types/params.pb.go +++ b/x/pricefeed/types/params.pb.go @@ -6,16 +6,17 @@ package types import ( bytes "bytes" fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + time "time" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" _ "github.com/regen-network/cosmos-proto" _ "google.golang.org/protobuf/types/known/timestamppb" - io "io" - math "math" - math_bits "math/bits" - time "time" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/pricefeed/types/query.pb.go b/x/pricefeed/types/query.pb.go index c9efc534f..0e51ea81a 100644 --- a/x/pricefeed/types/query.pb.go +++ b/x/pricefeed/types/query.pb.go @@ -6,6 +6,11 @@ package types import ( context "context" fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + time "time" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" @@ -16,10 +21,6 @@ import ( codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" _ "google.golang.org/protobuf/types/known/timestamppb" - io "io" - math "math" - math_bits "math/bits" - time "time" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/pricefeed/types/tx.pb.go b/x/pricefeed/types/tx.pb.go index 92db72f0a..27a88f84f 100644 --- a/x/pricefeed/types/tx.pb.go +++ b/x/pricefeed/types/tx.pb.go @@ -6,6 +6,11 @@ package types import ( context "context" fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + time "time" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" @@ -16,10 +21,6 @@ import ( codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" _ "google.golang.org/protobuf/types/known/timestamppb" - io "io" - math "math" - math_bits "math/bits" - time "time" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/stablecoin/types/genesis.pb.go b/x/stablecoin/types/genesis.pb.go index 2297b3076..71b6408bd 100644 --- a/x/stablecoin/types/genesis.pb.go +++ b/x/stablecoin/types/genesis.pb.go @@ -5,12 +5,13 @@ package types import ( fmt "fmt" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" io "io" math "math" math_bits "math/bits" + + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/stablecoin/types/params.pb.go b/x/stablecoin/types/params.pb.go index abae8d7ad..dfee4e090 100644 --- a/x/stablecoin/types/params.pb.go +++ b/x/stablecoin/types/params.pb.go @@ -5,11 +5,12 @@ package types import ( fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" io "io" math "math" math_bits "math/bits" + + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/stablecoin/types/query.pb.go b/x/stablecoin/types/query.pb.go index b3314e602..d02517a3a 100644 --- a/x/stablecoin/types/query.pb.go +++ b/x/stablecoin/types/query.pb.go @@ -6,6 +6,10 @@ package types import ( context "context" fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/query" @@ -16,9 +20,6 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/stablecoin/types/tx.pb.go b/x/stablecoin/types/tx.pb.go index 74f11018c..590bdc579 100644 --- a/x/stablecoin/types/tx.pb.go +++ b/x/stablecoin/types/tx.pb.go @@ -6,6 +6,10 @@ package types import ( context "context" fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" @@ -15,9 +19,6 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/testutil/cli/network_test.go b/x/testutil/cli/network_test.go index 631fd3ea6..75790248f 100644 --- a/x/testutil/cli/network_test.go +++ b/x/testutil/cli/network_test.go @@ -7,9 +7,8 @@ import ( "testing" "time" + "github.com/cosmos/cosmos-sdk/testutil/network" "github.com/stretchr/testify/suite" - - "github.com/NibiruChain/nibiru/x/testutil/cli" ) type IntegrationTestSuite struct { diff --git a/x/vpool/types/vpool.pb.go b/x/vpool/types/vpool.pb.go index edd766239..e482b3607 100644 --- a/x/vpool/types/vpool.pb.go +++ b/x/vpool/types/vpool.pb.go @@ -5,13 +5,14 @@ package types import ( fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" _ "github.com/regen-network/cosmos-proto" - io "io" - math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used.