diff --git a/app/app.go b/app/app.go index d219fb6c69..54056cf870 100644 --- a/app/app.go +++ b/app/app.go @@ -46,7 +46,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/auth/ante" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting" @@ -873,34 +872,7 @@ func New( app.setupUpgradeHandlers() // create the simulation manager and define the order of the modules for deterministic simulations - app.sm = module.NewSimulationManager( - auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)), - bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)), - capability.NewAppModule(appCodec, *app.CapabilityKeeper, false), - feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), - gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), - staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), - distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName)), - params.NewAppModule(app.ParamsKeeper), - evidence.NewAppModule(app.EvidenceKeeper), - ibc.NewAppModule(app.IBCKeeper), - groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), - authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), - transferModule, - specModule, - epochstorageModule, - dualstakingModule, - subscriptionModule, - pairingModule, - conflictModule, - projectsModule, - protocolModule, - plansModule, - rewardsModule, - // this line is used by starport scaffolding # stargate/app/appModule - ) - app.sm.RegisterStoreDecoders() + app.sm = module.NewSimulationManager() // initialize stores app.MountKVStores(keys) diff --git a/app/simulation_test.go b/app/simulation_test.go deleted file mode 100644 index 73fb5dc02f..0000000000 --- a/app/simulation_test.go +++ /dev/null @@ -1,92 +0,0 @@ -package app_test - -import ( - "os" - "testing" - "time" - - "github.com/cosmos/cosmos-sdk/testutil/sims" - - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtypes "github.com/cometbft/cometbft/types" - simulationtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" - "github.com/cosmos/ibc-go/v7/testing/simapp" - "github.com/lavanet/lava/v4/app" - "github.com/stretchr/testify/require" -) - -func init() { - cli.GetSimulatorFlags() -} - -var defaultConsensusParams = &tmproto.ConsensusParams{ - Block: &tmproto.BlockParams{ - MaxBytes: 200000, - MaxGas: 2000000, - }, - Evidence: &tmproto.EvidenceParams{ - MaxAgeNumBlocks: 302400, - MaxAgeDuration: 504 * time.Hour, // 3 weeks is the max duration - MaxBytes: 10000, - }, - Validator: &tmproto.ValidatorParams{ - PubKeyTypes: []string{ - tmtypes.ABCIPubKeyTypeEd25519, - }, - }, -} - -// BenchmarkSimulation run the chain simulation -// Running using starport command: -// `starport chain simulate -v --numBlocks 200 --blockSize 50` -// Running as go benchmark test: -// `go test -benchmem -run=^$ -bench ^BenchmarkSimulation ./app -NumBlocks=200 -BlockSize 50 -Commit=true -Verbose=true -Enabled=true` -func BenchmarkSimulation(b *testing.B) { - simapp.FlagEnabledValue = true - simapp.FlagCommitValue = true - config, db, dir, logger, _, err := simapp.SetupSimulation("goleveldb-app-sim", "Simulation") - require.NoError(b, err, "simulation setup failed") - - b.Cleanup(func() { - db.Close() - err = os.RemoveAll(dir) - require.NoError(b, err) - }) - - encoding := app.MakeEncodingConfig() - - app := app.New( - logger, - db, - nil, - true, - map[int64]bool{}, - app.DefaultNodeHome, - 0, - encoding, - sims.EmptyAppOptions{}, - ) - - // Run randomized simulations - _, simParams, simErr := simulation.SimulateFromSeed( - b, - os.Stdout, - app.BaseApp, - simapp.AppStateFn(app.AppCodec(), app.SimulationManager()), - simulationtypes.RandomAccounts, - sims.SimulationOperations(app, app.AppCodec(), config), - app.ModuleAccountAddrs(), - config, - app.AppCodec(), - ) - - err = sims.CheckExportSimulation(app, config, simParams) - require.NoError(b, err) - require.NoError(b, simErr) - - if config.Commit { - simapp.PrintStats(db) - } -} diff --git a/x/conflict/module_simulation.go b/x/conflict/module_simulation.go deleted file mode 100644 index 43fea0d140..0000000000 --- a/x/conflict/module_simulation.go +++ /dev/null @@ -1,118 +0,0 @@ -package conflict - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/testutil/sims" - types2 "github.com/cosmos/cosmos-sdk/x/auth/types" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/v4/testutil/sample" - conflictsimulation "github.com/lavanet/lava/v4/x/conflict/simulation" - "github.com/lavanet/lava/v4/x/conflict/types" -) - -// avoid unused import issue -var ( - _ = sample.AccAddress - _ = conflictsimulation.FindAccount - _ = sims.StakePerAccount - _ = simulation.MsgEntryKind - _ = baseapp.Paramspace -) - -const ( - opWeightMsgDetection = "op_weight_msg_create_chain" - // TODO: Determine the simulation weight value - defaultWeightMsgDetection int = 100 - - opWeightMsgConflictVoteCommit = "op_weight_msg_conflict_vote_commit" - // TODO: Determine the simulation weight value - defaultWeightMsgConflictVoteCommit int = 100 - - opWeightMsgConflictVoteReveal = "op_weight_msg_conflict_vote_reveal" - // TODO: Determine the simulation weight value - defaultWeightMsgConflictVoteReveal int = 100 - - // this line is used by starport scaffolding # simapp/module/const -) - -// GenerateGenesisState creates a randomized GenState of the module -func (AppModule) GenerateGenesisState(simState *module.SimulationState) { - accs := make([]string, len(simState.Accounts)) - for i, acc := range simState.Accounts { - accs[i] = acc.Address.String() - } - conflictGenesis := types.GenesisState{ - // this line is used by starport scaffolding # simapp/module/genesisState - } - simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&conflictGenesis) -} - -// TODO: Add weighted proposals -func (AppModule) ProposalMsgs(_ module.SimulationState) []simtypes.WeightedProposalMsg { - return []simtypes.WeightedProposalMsg{ - simulation.NewWeightedProposalMsg("op_weight_msg_update_params", 100, func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { - return &types2.MsgUpdateParams{} - }), - } -} - -//// RandomizedParams creates randomized param changes for the simulator -// func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { -// conflictParams := types.DefaultParams() -// return []simtypes.ParamChange{ -// simulation.NewSimParamChange(types.ModuleName, string(types.KeyMajorityPercent), func(r *rand.Rand) string { -// return string(types.Amino.MustMarshalJSON(conflictParams.MajorityPercent)) -// }), -// } -// } - -// RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} - -// WeightedOperations returns the all the gov module operations with their respective weights. -func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { - operations := make([]simtypes.WeightedOperation, 0) - - var weightMsgDetection int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgDetection, &weightMsgDetection, nil, - func(_ *rand.Rand) { - weightMsgDetection = defaultWeightMsgDetection - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgDetection, - conflictsimulation.SimulateMsgDetection(am.accountKeeper, am.bankKeeper, am.keeper), - )) - - var weightMsgConflictVoteCommit int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgConflictVoteCommit, &weightMsgConflictVoteCommit, nil, - func(_ *rand.Rand) { - weightMsgConflictVoteCommit = defaultWeightMsgConflictVoteCommit - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgConflictVoteCommit, - conflictsimulation.SimulateMsgConflictVoteCommit(am.accountKeeper, am.bankKeeper, am.keeper), - )) - - var weightMsgConflictVoteReveal int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgConflictVoteReveal, &weightMsgConflictVoteReveal, nil, - func(_ *rand.Rand) { - weightMsgConflictVoteReveal = defaultWeightMsgConflictVoteReveal - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgConflictVoteReveal, - conflictsimulation.SimulateMsgConflictVoteReveal(am.accountKeeper, am.bankKeeper, am.keeper), - )) - - // this line is used by starport scaffolding # simapp/module/operation - - return operations -} diff --git a/x/conflict/simulation/conflict_vote_commit.go b/x/conflict/simulation/conflict_vote_commit.go deleted file mode 100644 index e9bb19a51f..0000000000 --- a/x/conflict/simulation/conflict_vote_commit.go +++ /dev/null @@ -1,29 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v4/x/conflict/keeper" - "github.com/lavanet/lava/v4/x/conflict/types" -) - -func SimulateMsgConflictVoteCommit( - ak types.AccountKeeper, - bk types.BankKeeper, - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - msg := &types.MsgConflictVoteCommit{ - Creator: simAccount.Address.String(), - } - - // TODO: Handling the ConflictVoteCommit simulation - - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "ConflictVoteCommit simulation not implemented"), nil, nil - } -} diff --git a/x/conflict/simulation/conflict_vote_reveal.go b/x/conflict/simulation/conflict_vote_reveal.go deleted file mode 100644 index f77bd6ce77..0000000000 --- a/x/conflict/simulation/conflict_vote_reveal.go +++ /dev/null @@ -1,29 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v4/x/conflict/keeper" - "github.com/lavanet/lava/v4/x/conflict/types" -) - -func SimulateMsgConflictVoteReveal( - ak types.AccountKeeper, - bk types.BankKeeper, - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - msg := &types.MsgConflictVoteReveal{ - Creator: simAccount.Address.String(), - } - - // TODO: Handling the ConflictVoteReveal simulation - - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "ConflictVoteReveal simulation not implemented"), nil, nil - } -} diff --git a/x/conflict/simulation/detection.go b/x/conflict/simulation/detection.go deleted file mode 100644 index 6444cd204c..0000000000 --- a/x/conflict/simulation/detection.go +++ /dev/null @@ -1,29 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v4/x/conflict/keeper" - "github.com/lavanet/lava/v4/x/conflict/types" -) - -func SimulateMsgDetection( - ak types.AccountKeeper, - bk types.BankKeeper, - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - msg := &types.MsgDetection{ - Creator: simAccount.Address.String(), - } - - // TODO: Handling the Detection simulation - - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "Detection simulation not implemented"), nil, nil - } -} diff --git a/x/conflict/simulation/simap.go b/x/conflict/simulation/simap.go deleted file mode 100644 index 92c437c0d1..0000000000 --- a/x/conflict/simulation/simap.go +++ /dev/null @@ -1,15 +0,0 @@ -package simulation - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" -) - -// FindAccount find a specific address from an account list -func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { - creator, err := sdk.AccAddressFromBech32(address) - if err != nil { - panic(err) - } - return simtypes.FindAccount(accs, creator) -} diff --git a/x/dualstaking/migrations/v4/delegator_reward.pb.go b/x/dualstaking/migrations/v4/delegator_reward.pb.go deleted file mode 100644 index f469e4ee1d..0000000000 --- a/x/dualstaking/migrations/v4/delegator_reward.pb.go +++ /dev/null @@ -1,481 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: lavanet/lava/dualstaking/delegator_reward.proto - -package types - -import ( - fmt "fmt" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type DelegatorRewardv4 struct { - Delegator string `protobuf:"bytes,1,opt,name=delegator,proto3" json:"delegator,omitempty"` - Provider string `protobuf:"bytes,2,opt,name=provider,proto3" json:"provider,omitempty"` - ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - Amount types.Coin `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount"` -} - -func (m *DelegatorRewardv4) Reset() { *m = DelegatorRewardv4{} } -func (m *DelegatorRewardv4) String() string { return proto.CompactTextString(m) } -func (*DelegatorRewardv4) ProtoMessage() {} -func (*DelegatorRewardv4) Descriptor() ([]byte, []int) { - return fileDescriptor_c8b6da054bf40d1f, []int{0} -} -func (m *DelegatorRewardv4) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DelegatorRewardv4) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DelegatorReward.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 *DelegatorRewardv4) XXX_Merge(src proto.Message) { - xxx_messageInfo_DelegatorReward.Merge(m, src) -} -func (m *DelegatorRewardv4) XXX_Size() int { - return m.Size() -} -func (m *DelegatorRewardv4) XXX_DiscardUnknown() { - xxx_messageInfo_DelegatorReward.DiscardUnknown(m) -} - -var xxx_messageInfo_DelegatorReward proto.InternalMessageInfo - -func (m *DelegatorRewardv4) GetDelegator() string { - if m != nil { - return m.Delegator - } - return "" -} - -func (m *DelegatorRewardv4) GetProvider() string { - if m != nil { - return m.Provider - } - return "" -} - -func (m *DelegatorRewardv4) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - -func (m *DelegatorRewardv4) GetAmount() types.Coin { - if m != nil { - return m.Amount - } - return types.Coin{} -} - -func init() { - proto.RegisterType((*DelegatorRewardv4)(nil), "lavanet.lava.dualstaking.DelegatorRewardv4") -} - -func init() { - proto.RegisterFile("lavanet/lava/dualstaking/delegator_reward.proto", fileDescriptor_c8b6da054bf40d1f) -} - -var fileDescriptor_c8b6da054bf40d1f = []byte{ - // 281 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x50, 0xb1, 0x4e, 0xf3, 0x30, - 0x18, 0x8c, 0xff, 0xbf, 0x2a, 0xad, 0x19, 0x90, 0x22, 0x86, 0x34, 0x42, 0xa6, 0x62, 0xaa, 0x84, - 0x64, 0xab, 0x30, 0xb0, 0x17, 0x18, 0x58, 0x33, 0xb2, 0x54, 0x4e, 0x6c, 0xa5, 0x16, 0x89, 0xbf, - 0xc8, 0x71, 0x02, 0xbc, 0x05, 0x6f, 0xc0, 0xeb, 0x74, 0xec, 0xc8, 0x84, 0x50, 0xf2, 0x22, 0x28, - 0x4e, 0x28, 0x74, 0xfa, 0xfc, 0xf9, 0xee, 0x74, 0xf7, 0x1d, 0x66, 0x19, 0xaf, 0xb9, 0x96, 0xd6, - 0x4d, 0x26, 0x2a, 0x9e, 0x95, 0x96, 0x3f, 0x29, 0x9d, 0x32, 0x21, 0x33, 0x99, 0x72, 0x0b, 0x66, - 0x6d, 0xe4, 0x33, 0x37, 0x82, 0x16, 0x06, 0x2c, 0xf8, 0xc1, 0x20, 0xa0, 0xdd, 0xa4, 0x7f, 0x04, - 0xe1, 0x69, 0x0a, 0x29, 0x38, 0x12, 0xeb, 0x5e, 0x3d, 0x3f, 0x24, 0x09, 0x94, 0x39, 0x94, 0x2c, - 0xe6, 0xa5, 0x64, 0xf5, 0x32, 0x96, 0x96, 0x2f, 0x59, 0x02, 0x4a, 0xf7, 0xf8, 0xc5, 0x3b, 0xc2, - 0x27, 0x77, 0x3f, 0x56, 0x91, 0x73, 0xf2, 0xcf, 0xf0, 0x74, 0xef, 0x1e, 0xa0, 0x39, 0x5a, 0x4c, - 0xa3, 0xdf, 0x0f, 0x3f, 0xc4, 0x93, 0xc2, 0x40, 0xad, 0x84, 0x34, 0xc1, 0x3f, 0x07, 0xee, 0x77, - 0x7f, 0x86, 0x27, 0xc9, 0x86, 0x2b, 0xbd, 0x56, 0x22, 0xf8, 0xef, 0xb0, 0x23, 0xb7, 0x3f, 0x08, - 0xff, 0x06, 0x8f, 0x79, 0x0e, 0x95, 0xb6, 0xc1, 0x68, 0x8e, 0x16, 0xc7, 0x57, 0x33, 0xda, 0x27, - 0xa3, 0x5d, 0x32, 0x3a, 0x24, 0xa3, 0xb7, 0xa0, 0xf4, 0x6a, 0xb4, 0xfd, 0x3c, 0xf7, 0xa2, 0x81, - 0xbe, 0xba, 0xdf, 0x36, 0x04, 0xed, 0x1a, 0x82, 0xbe, 0x1a, 0x82, 0xde, 0x5a, 0xe2, 0xed, 0x5a, - 0xe2, 0x7d, 0xb4, 0xc4, 0x7b, 0xbc, 0x4c, 0x95, 0xdd, 0x54, 0x31, 0x4d, 0x20, 0x3f, 0xec, 0xf1, - 0xe5, 0xa0, 0x49, 0xfb, 0x5a, 0xc8, 0x32, 0x1e, 0xbb, 0x7b, 0xaf, 0xbf, 0x03, 0x00, 0x00, 0xff, - 0xff, 0x2c, 0x0a, 0x50, 0x1d, 0x72, 0x01, 0x00, 0x00, -} - -func (m *DelegatorRewardv4) 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 *DelegatorRewardv4) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DelegatorRewardv4) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDelegatorReward(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintDelegatorReward(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0x1a - } - if len(m.Provider) > 0 { - i -= len(m.Provider) - copy(dAtA[i:], m.Provider) - i = encodeVarintDelegatorReward(dAtA, i, uint64(len(m.Provider))) - i-- - dAtA[i] = 0x12 - } - if len(m.Delegator) > 0 { - i -= len(m.Delegator) - copy(dAtA[i:], m.Delegator) - i = encodeVarintDelegatorReward(dAtA, i, uint64(len(m.Delegator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintDelegatorReward(dAtA []byte, offset int, v uint64) int { - offset -= sovDelegatorReward(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *DelegatorRewardv4) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Delegator) - if l > 0 { - n += 1 + l + sovDelegatorReward(uint64(l)) - } - l = len(m.Provider) - if l > 0 { - n += 1 + l + sovDelegatorReward(uint64(l)) - } - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovDelegatorReward(uint64(l)) - } - l = m.Amount.Size() - n += 1 + l + sovDelegatorReward(uint64(l)) - return n -} - -func sovDelegatorReward(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozDelegatorReward(x uint64) (n int) { - return sovDelegatorReward(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *DelegatorRewardv4) 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 ErrIntOverflowDelegatorReward - } - 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: DelegatorReward: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DelegatorReward: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Delegator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDelegatorReward - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDelegatorReward - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDelegatorReward - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Delegator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Provider", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDelegatorReward - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDelegatorReward - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDelegatorReward - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Provider = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDelegatorReward - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDelegatorReward - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDelegatorReward - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDelegatorReward - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDelegatorReward - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDelegatorReward - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDelegatorReward(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDelegatorReward - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipDelegatorReward(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDelegatorReward - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDelegatorReward - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDelegatorReward - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthDelegatorReward - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupDelegatorReward - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthDelegatorReward - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthDelegatorReward = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowDelegatorReward = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupDelegatorReward = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/dualstaking/module_simulation.go b/x/dualstaking/module_simulation.go deleted file mode 100644 index beaddac229..0000000000 --- a/x/dualstaking/module_simulation.go +++ /dev/null @@ -1,124 +0,0 @@ -package dualstaking - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/v4/testutil/sample" - dualstakingsimulation "github.com/lavanet/lava/v4/x/dualstaking/simulation" - "github.com/lavanet/lava/v4/x/dualstaking/types" -) - -// avoid unused import issue -var ( - _ = sample.AccAddress - _ = dualstakingsimulation.FindAccount - _ = simulation.MsgEntryKind - _ = baseapp.Paramspace - _ = rand.Rand{} -) - -const ( - opWeightMsgDelegate = "op_weight_msg_delegate" - // TODO: Determine the simulation weight value - defaultWeightMsgDelegate int = 100 - - opWeightMsgRedelegate = "op_weight_msg_redelegate" - // TODO: Determine the simulation weight value - defaultWeightMsgRedelegate int = 100 - - opWeightMsgUnbond = "op_weight_msg_unbond" - // TODO: Determine the simulation weight value - defaultWeightMsgUnbond int = 100 - - opWeightMsgClaimRewards = "op_weight_msg_claim_rewards" - // TODO: Determine the simulation weight value - defaultWeightMsgClaimRewards int = 100 - - // this line is used by starport scaffolding # simapp/module/const -) - -// GenerateGenesisState creates a randomized GenState of the module. -func (AppModule) GenerateGenesisState(simState *module.SimulationState) { - accs := make([]string, len(simState.Accounts)) - for i, acc := range simState.Accounts { - accs[i] = acc.Address.String() - } - dualstakingGenesis := types.GenesisState{ - Params: types.DefaultParams(), - // this line is used by starport scaffolding # simapp/module/genesisState - } - simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&dualstakingGenesis) -} - -// RegisterStoreDecoder registers a decoder. -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} - -// ProposalContents doesn't return any content functions for governance proposals. -func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalMsg { - return nil -} - -// WeightedOperations returns the all the gov module operations with their respective weights. -func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { - operations := make([]simtypes.WeightedOperation, 0) - - var weightMsgDelegate int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgDelegate, &weightMsgDelegate, nil, - func(_ *rand.Rand) { - weightMsgDelegate = defaultWeightMsgDelegate - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgDelegate, - dualstakingsimulation.SimulateMsgDelegate(am.accountKeeper, am.bankKeeper, am.keeper), - )) - - var weightMsgRedelegate int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgRedelegate, &weightMsgRedelegate, nil, - func(_ *rand.Rand) { - weightMsgRedelegate = defaultWeightMsgRedelegate - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgRedelegate, - dualstakingsimulation.SimulateMsgRedelegate(am.accountKeeper, am.bankKeeper, am.keeper), - )) - - var weightMsgUnbond int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgUnbond, &weightMsgUnbond, nil, - func(_ *rand.Rand) { - weightMsgUnbond = defaultWeightMsgUnbond - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgUnbond, - dualstakingsimulation.SimulateMsgUnbond(am.accountKeeper, am.bankKeeper, am.keeper), - )) - - var weightMsgClaimRewards int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgClaimRewards, &weightMsgClaimRewards, nil, - func(_ *rand.Rand) { - weightMsgClaimRewards = defaultWeightMsgClaimRewards - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgClaimRewards, - dualstakingsimulation.SimulateMsgClaimRewards(am.accountKeeper, am.bankKeeper, am.keeper), - )) - - // this line is used by starport scaffolding # simapp/module/operation - - return operations -} - -// ProposalMsgs returns msgs used for governance proposals for simulations. -func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg { - return []simtypes.WeightedProposalMsg{ - // this line is used by starport scaffolding # simapp/module/OpMsg - } -} diff --git a/x/dualstaking/simulation/claim_rewards.go b/x/dualstaking/simulation/claim_rewards.go deleted file mode 100644 index bfbe077299..0000000000 --- a/x/dualstaking/simulation/claim_rewards.go +++ /dev/null @@ -1,29 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v4/x/dualstaking/keeper" - "github.com/lavanet/lava/v4/x/dualstaking/types" -) - -func SimulateMsgClaimRewards( - ak types.AccountKeeper, - bk types.BankKeeper, - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - msg := &types.MsgClaimRewards{ - Creator: simAccount.Address.String(), - } - - // TODO: Handling the ClaimRewards simulation - - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "ClaimRewards simulation not implemented"), nil, nil - } -} diff --git a/x/dualstaking/simulation/delegate.go b/x/dualstaking/simulation/delegate.go deleted file mode 100644 index bf12e20b40..0000000000 --- a/x/dualstaking/simulation/delegate.go +++ /dev/null @@ -1,65 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v4/x/dualstaking/keeper" - "github.com/lavanet/lava/v4/x/dualstaking/types" -) - -func SimulateMsgDelegate( - ak types.AccountKeeper, - bk types.BankKeeper, - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - msg := &types.MsgDelegate{ - Creator: simAccount.Address.String(), - } - - // TODO: Handling the Delegate simulation - - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "Delegate simulation not implemented"), nil, nil - } -} - -func SimulateMsgRedelegate( - ak types.AccountKeeper, - bk types.BankKeeper, - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - msg := &types.MsgRedelegate{ - Creator: simAccount.Address.String(), - } - - // TODO: Handling the Redelegate simulation - - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "Redelegate simulation not implemented"), nil, nil - } -} - -func SimulateMsgUnbond( - ak types.AccountKeeper, - bk types.BankKeeper, - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - msg := &types.MsgUnbond{ - Creator: simAccount.Address.String(), - } - - // TODO: Handling the Unbond simulation - - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "Unbond simulation not implemented"), nil, nil - } -} diff --git a/x/dualstaking/simulation/helpers.go b/x/dualstaking/simulation/helpers.go deleted file mode 100644 index 92c437c0d1..0000000000 --- a/x/dualstaking/simulation/helpers.go +++ /dev/null @@ -1,15 +0,0 @@ -package simulation - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" -) - -// FindAccount find a specific address from an account list -func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { - creator, err := sdk.AccAddressFromBech32(address) - if err != nil { - panic(err) - } - return simtypes.FindAccount(accs, creator) -} diff --git a/x/epochstorage/keeper/migrations.go b/x/epochstorage/keeper/migrations.go index b6871ef26f..f00f382cd8 100644 --- a/x/epochstorage/keeper/migrations.go +++ b/x/epochstorage/keeper/migrations.go @@ -12,7 +12,6 @@ import ( "github.com/lavanet/lava/v4/utils" "github.com/lavanet/lava/v4/x/epochstorage/types" v3 "github.com/lavanet/lava/v4/x/epochstorage/types/migrations/v3" - v6 "github.com/lavanet/lava/v4/x/epochstorage/types/migrations/v6" ) type Migrator struct { @@ -23,53 +22,6 @@ func NewMigrator(keeper Keeper) Migrator { return Migrator{keeper: keeper} } -// Migrate5to6 goes over all existing stake entries and populates the new vault address field with the stake entry address -func (m Migrator) Migrate5to6(ctx sdk.Context) error { - utils.LavaFormatDebug("migrate: epochstorage to include provider and vault addresses") - - store := prefix.NewStore(ctx.KVStore(m.keeper.storeKey), types.KeyPrefix(v3.StakeStorageKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var stakeStorageV6 v6.StakeStorage - m.keeper.cdc.MustUnmarshal(iterator.Value(), &stakeStorageV6) - - for i := range stakeStorageV6.StakeEntries { - stakeStorageV6.StakeEntries[i].Vault = stakeStorageV6.StakeEntries[i].Address - } - - store.Set(iterator.Key(), m.keeper.cdc.MustMarshal(&stakeStorageV6)) - } - - return nil -} - -// Migrate6to7 goes over all existing stake entries and populates the new description field with current moniker -func (m Migrator) Migrate6to7(ctx sdk.Context) error { - utils.LavaFormatDebug("migrate: epochstorage to include detailed description") - - store := prefix.NewStore(ctx.KVStore(m.keeper.storeKey), types.KeyPrefix(v3.StakeStorageKeyPrefix)) - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var stakeStorageV7 types.StakeStorage - m.keeper.cdc.MustUnmarshal(iterator.Value(), &stakeStorageV7) - - for i := range stakeStorageV7.StakeEntries { - stakeStorageV7.StakeEntries[i].Description.Moniker = stakeStorageV7.StakeEntries[i].Moniker - stakeStorageV7.StakeEntries[i].Moniker = "" - } - - store.Set(iterator.Key(), m.keeper.cdc.MustMarshal(&stakeStorageV7)) - } - - return nil -} - // Migrate7to8 transfers all the stake entries from the old stake storage to the new stake entries store // StakeStorage is set to the stake entries store // StakeStorageCurrent is set to the stake entries current store diff --git a/x/epochstorage/module.go b/x/epochstorage/module.go index 6e6cba0642..900c9e0762 100644 --- a/x/epochstorage/module.go +++ b/x/epochstorage/module.go @@ -130,18 +130,6 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { migrator := keeper.NewMigrator(am.keeper) - // register v5 -> v6 migration - if err := cfg.RegisterMigration(types.ModuleName, 5, migrator.Migrate5to6); err != nil { - // panic:ok: at start up, migration cannot proceed anyhow - panic(fmt.Errorf("%s: failed to register migration to v6: %w", types.ModuleName, err)) - } - - // register v6 -> v7 migration - if err := cfg.RegisterMigration(types.ModuleName, 6, migrator.Migrate6to7); err != nil { - // panic:ok: at start up, migration cannot proceed anyhow - panic(fmt.Errorf("%s: failed to register migration to v7: %w", types.ModuleName, err)) - } - // register v7 -> v8 migration if err := cfg.RegisterMigration(types.ModuleName, 7, migrator.Migrate7to8); err != nil { // panic:ok: at start up, migration cannot proceed anyhow diff --git a/x/epochstorage/module_simulation.go b/x/epochstorage/module_simulation.go deleted file mode 100644 index 59cc07cb51..0000000000 --- a/x/epochstorage/module_simulation.go +++ /dev/null @@ -1,84 +0,0 @@ -package epochstorage - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/testutil/sims" - types2 "github.com/cosmos/cosmos-sdk/x/auth/types" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/v4/testutil/sample" - epochstoragesimulation "github.com/lavanet/lava/v4/x/epochstorage/simulation" - "github.com/lavanet/lava/v4/x/epochstorage/types" -) - -// avoid unused import issue -var ( - _ = sample.AccAddress - _ = epochstoragesimulation.FindAccount - _ = sims.StakePerAccount - _ = simulation.MsgEntryKind - _ = baseapp.Paramspace -) - -const ( -// this line is used by starport scaffolding # simapp/module/const -) - -// GenerateGenesisState creates a randomized GenState of the module -func (AppModule) GenerateGenesisState(simState *module.SimulationState) { - accs := make([]string, len(simState.Accounts)) - for i, acc := range simState.Accounts { - accs[i] = acc.Address.String() - } - epochstorageGenesis := types.GenesisState{ - // this line is used by starport scaffolding # simapp/module/genesisState - } - simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&epochstorageGenesis) -} - -// ProposalContents doesn't return any content functions for governance proposals -func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalMsg { - return nil -} - -// TODO: Add weighted proposals -func (AppModule) ProposalMsgs(_ module.SimulationState) []simtypes.WeightedProposalMsg { - return []simtypes.WeightedProposalMsg{ - simulation.NewWeightedProposalMsg("op_weight_msg_update_params", 100, func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { - return &types2.MsgUpdateParams{} - }), - } -} - -//// RandomizedParams creates randomized param changes for the simulator -// func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { -// epochstorageParams := types.DefaultParams() -// return []simtypes.ParamChange{ -// simulation.NewSimParamChange(types.ModuleName, string(types.KeyUnstakeHoldBlocks), func(r *rand.Rand) string { -// return string(types.Amino.MustMarshalJSON(epochstorageParams.UnstakeHoldBlocks)) -// }), -// simulation.NewSimParamChange(types.ModuleName, string(types.KeyEpochBlocks), func(r *rand.Rand) string { -// return string(types.Amino.MustMarshalJSON(epochstorageParams.EpochBlocks)) -// }), -// simulation.NewSimParamChange(types.ModuleName, string(types.KeyEpochsToSave), func(r *rand.Rand) string { -// return string(types.Amino.MustMarshalJSON(epochstorageParams.EpochsToSave)) -// }), -// } -// } - -// RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} - -// WeightedOperations returns the all the gov module operations with their respective weights. -func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { - operations := make([]simtypes.WeightedOperation, 0) - - // this line is used by starport scaffolding # simapp/module/operation - - return operations -} diff --git a/x/epochstorage/simulation/simap.go b/x/epochstorage/simulation/simap.go deleted file mode 100644 index 92c437c0d1..0000000000 --- a/x/epochstorage/simulation/simap.go +++ /dev/null @@ -1,15 +0,0 @@ -package simulation - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" -) - -// FindAccount find a specific address from an account list -func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { - creator, err := sdk.AccAddressFromBech32(address) - if err != nil { - panic(err) - } - return simtypes.FindAccount(accs, creator) -} diff --git a/x/epochstorage/types/migrations/v6/endpoint.pb.go b/x/epochstorage/types/migrations/v6/endpoint.pb.go deleted file mode 100644 index ed0ac20326..0000000000 --- a/x/epochstorage/types/migrations/v6/endpoint.pb.go +++ /dev/null @@ -1,522 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: lavanet/lava/epochstorage/endpoint.proto - -package types - -import ( - fmt "fmt" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Endpoint struct { - IPPORT string `protobuf:"bytes,1,opt,name=iPPORT,proto3" json:"iPPORT,omitempty"` - Geolocation int32 `protobuf:"varint,3,opt,name=geolocation,proto3" json:"geolocation,omitempty"` - Addons []string `protobuf:"bytes,4,rep,name=addons,proto3" json:"addons,omitempty"` - ApiInterfaces []string `protobuf:"bytes,5,rep,name=api_interfaces,json=apiInterfaces,proto3" json:"api_interfaces,omitempty"` - Extensions []string `protobuf:"bytes,6,rep,name=extensions,proto3" json:"extensions,omitempty"` -} - -func (m *Endpoint) Reset() { *m = Endpoint{} } -func (m *Endpoint) String() string { return proto.CompactTextString(m) } -func (*Endpoint) ProtoMessage() {} -func (*Endpoint) Descriptor() ([]byte, []int) { - return fileDescriptor_acb18a6b0d300ae9, []int{0} -} -func (m *Endpoint) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Endpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Endpoint.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 *Endpoint) XXX_Merge(src proto.Message) { - xxx_messageInfo_Endpoint.Merge(m, src) -} -func (m *Endpoint) XXX_Size() int { - return m.Size() -} -func (m *Endpoint) XXX_DiscardUnknown() { - xxx_messageInfo_Endpoint.DiscardUnknown(m) -} - -var xxx_messageInfo_Endpoint proto.InternalMessageInfo - -func (m *Endpoint) GetIPPORT() string { - if m != nil { - return m.IPPORT - } - return "" -} - -func (m *Endpoint) GetGeolocation() int32 { - if m != nil { - return m.Geolocation - } - return 0 -} - -func (m *Endpoint) GetAddons() []string { - if m != nil { - return m.Addons - } - return nil -} - -func (m *Endpoint) GetApiInterfaces() []string { - if m != nil { - return m.ApiInterfaces - } - return nil -} - -func (m *Endpoint) GetExtensions() []string { - if m != nil { - return m.Extensions - } - return nil -} - -func init() { - proto.RegisterType((*Endpoint)(nil), "lavanet.lava.epochstorage.EndpointV6") -} - -func init() { - proto.RegisterFile("lavanet/lava/epochstorage/endpoint.proto", fileDescriptor_acb18a6b0d300ae9) -} - -var fileDescriptor_acb18a6b0d300ae9 = []byte{ - // 250 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xc8, 0x49, 0x2c, 0x4b, - 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0xa9, 0x05, 0xf9, 0xc9, 0x19, 0xc5, 0x25, 0xf9, 0x45, - 0x89, 0xe9, 0xa9, 0xfa, 0xa9, 0x79, 0x29, 0x05, 0xf9, 0x99, 0x79, 0x25, 0x7a, 0x05, 0x45, 0xf9, - 0x25, 0xf9, 0x42, 0x92, 0x50, 0x95, 0x7a, 0x20, 0x5a, 0x0f, 0x59, 0xa5, 0xd2, 0x4a, 0x46, 0x2e, - 0x0e, 0x57, 0xa8, 0x6a, 0x21, 0x31, 0x2e, 0xb6, 0xcc, 0x80, 0x00, 0xff, 0xa0, 0x10, 0x09, 0x46, - 0x05, 0x46, 0x0d, 0xce, 0x20, 0x28, 0x4f, 0x48, 0x81, 0x8b, 0x3b, 0x3d, 0x35, 0x3f, 0x27, 0x3f, - 0x39, 0xb1, 0x24, 0x33, 0x3f, 0x4f, 0x82, 0x59, 0x81, 0x51, 0x83, 0x35, 0x08, 0x59, 0x08, 0xa4, - 0x33, 0x31, 0x25, 0x25, 0x3f, 0xaf, 0x58, 0x82, 0x45, 0x81, 0x19, 0xa4, 0x13, 0xc2, 0x13, 0x52, - 0xe5, 0xe2, 0x4b, 0x2c, 0xc8, 0x8c, 0xcf, 0xcc, 0x2b, 0x49, 0x2d, 0x4a, 0x4b, 0x4c, 0x4e, 0x2d, - 0x96, 0x60, 0x05, 0xcb, 0xf3, 0x26, 0x16, 0x64, 0x7a, 0xc2, 0x05, 0x85, 0xe4, 0xb8, 0xb8, 0x52, - 0x2b, 0x4a, 0x52, 0xf3, 0x8a, 0x33, 0x41, 0x46, 0xb0, 0x81, 0x95, 0x20, 0x89, 0x78, 0xb1, 0x70, - 0x30, 0x09, 0x30, 0x3b, 0xb9, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, - 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, - 0x4e, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x4a, 0xa8, 0x54, 0xa0, - 0x86, 0x4b, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x38, 0x54, 0x8c, 0x01, 0x01, 0x00, 0x00, - 0xff, 0xff, 0xf3, 0xac, 0x09, 0xa5, 0x41, 0x01, 0x00, 0x00, -} - -func (m *Endpoint) 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 *Endpoint) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Endpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Extensions) > 0 { - for iNdEx := len(m.Extensions) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Extensions[iNdEx]) - copy(dAtA[i:], m.Extensions[iNdEx]) - i = encodeVarintEndpoint(dAtA, i, uint64(len(m.Extensions[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } - if len(m.ApiInterfaces) > 0 { - for iNdEx := len(m.ApiInterfaces) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ApiInterfaces[iNdEx]) - copy(dAtA[i:], m.ApiInterfaces[iNdEx]) - i = encodeVarintEndpoint(dAtA, i, uint64(len(m.ApiInterfaces[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if len(m.Addons) > 0 { - for iNdEx := len(m.Addons) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Addons[iNdEx]) - copy(dAtA[i:], m.Addons[iNdEx]) - i = encodeVarintEndpoint(dAtA, i, uint64(len(m.Addons[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if m.Geolocation != 0 { - i = encodeVarintEndpoint(dAtA, i, uint64(m.Geolocation)) - i-- - dAtA[i] = 0x18 - } - if len(m.IPPORT) > 0 { - i -= len(m.IPPORT) - copy(dAtA[i:], m.IPPORT) - i = encodeVarintEndpoint(dAtA, i, uint64(len(m.IPPORT))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintEndpoint(dAtA []byte, offset int, v uint64) int { - offset -= sovEndpoint(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Endpoint) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.IPPORT) - if l > 0 { - n += 1 + l + sovEndpoint(uint64(l)) - } - if m.Geolocation != 0 { - n += 1 + sovEndpoint(uint64(m.Geolocation)) - } - if len(m.Addons) > 0 { - for _, s := range m.Addons { - l = len(s) - n += 1 + l + sovEndpoint(uint64(l)) - } - } - if len(m.ApiInterfaces) > 0 { - for _, s := range m.ApiInterfaces { - l = len(s) - n += 1 + l + sovEndpoint(uint64(l)) - } - } - if len(m.Extensions) > 0 { - for _, s := range m.Extensions { - l = len(s) - n += 1 + l + sovEndpoint(uint64(l)) - } - } - return n -} - -func sovEndpoint(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozEndpoint(x uint64) (n int) { - return sovEndpoint(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Endpoint) 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 ErrIntOverflowEndpoint - } - 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: Endpoint: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Endpoint: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IPPORT", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEndpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEndpoint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEndpoint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IPPORT = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Geolocation", wireType) - } - m.Geolocation = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEndpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Geolocation |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Addons", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEndpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEndpoint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEndpoint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Addons = append(m.Addons, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ApiInterfaces", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEndpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEndpoint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEndpoint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ApiInterfaces = append(m.ApiInterfaces, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Extensions", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEndpoint - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEndpoint - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEndpoint - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Extensions = append(m.Extensions, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEndpoint(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEndpoint - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEndpoint(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEndpoint - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEndpoint - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEndpoint - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthEndpoint - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEndpoint - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEndpoint - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthEndpoint = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEndpoint = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEndpoint = fmt.Errorf("proto: unexpected end of group") -) \ No newline at end of file diff --git a/x/epochstorage/types/migrations/v6/stake_entry.pb.go b/x/epochstorage/types/migrations/v6/stake_entry.pb.go deleted file mode 100644 index ae92f42631..0000000000 --- a/x/epochstorage/types/migrations/v6/stake_entry.pb.go +++ /dev/null @@ -1,1106 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: lavanet/lava/epochstorage/stake_entry.proto - -package types - -import ( - fmt "fmt" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type StakeEntry struct { - Stake types.Coin `protobuf:"bytes,1,opt,name=stake,proto3" json:"stake"` - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - StakeAppliedBlock uint64 `protobuf:"varint,3,opt,name=stake_applied_block,json=stakeAppliedBlock,proto3" json:"stake_applied_block,omitempty"` - Endpoints []Endpoint `protobuf:"bytes,4,rep,name=endpoints,proto3" json:"endpoints"` - Geolocation int32 `protobuf:"varint,5,opt,name=geolocation,proto3" json:"geolocation,omitempty"` - Chain string `protobuf:"bytes,6,opt,name=chain,proto3" json:"chain,omitempty"` - Moniker string `protobuf:"bytes,8,opt,name=moniker,proto3" json:"moniker,omitempty"` - DelegateTotal types.Coin `protobuf:"bytes,9,opt,name=delegate_total,json=delegateTotal,proto3" json:"delegate_total"` - DelegateLimit types.Coin `protobuf:"bytes,10,opt,name=delegate_limit,json=delegateLimit,proto3" json:"delegate_limit"` - DelegateCommission uint64 `protobuf:"varint,11,opt,name=delegate_commission,json=delegateCommission,proto3" json:"delegate_commission,omitempty"` - LastChange uint64 `protobuf:"varint,12,opt,name=last_change,json=lastChange,proto3" json:"last_change,omitempty"` - BlockReport *BlockReport `protobuf:"bytes,13,opt,name=block_report,json=blockReport,proto3" json:"block_report,omitempty"` - Vault string `protobuf:"bytes,14,opt,name=vault,proto3" json:"vault,omitempty"` -} - -func (m *StakeEntry) Reset() { *m = StakeEntry{} } -func (m *StakeEntry) String() string { return proto.CompactTextString(m) } -func (*StakeEntry) ProtoMessage() {} -func (*StakeEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_df6302d6b53c056e, []int{0} -} -func (m *StakeEntry) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StakeEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StakeEntry.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 *StakeEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_StakeEntry.Merge(m, src) -} -func (m *StakeEntry) XXX_Size() int { - return m.Size() -} -func (m *StakeEntry) XXX_DiscardUnknown() { - xxx_messageInfo_StakeEntry.DiscardUnknown(m) -} - -var xxx_messageInfo_StakeEntry proto.InternalMessageInfo - -func (m *StakeEntry) GetStake() types.Coin { - if m != nil { - return m.Stake - } - return types.Coin{} -} - -func (m *StakeEntry) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -func (m *StakeEntry) GetStakeAppliedBlock() uint64 { - if m != nil { - return m.StakeAppliedBlock - } - return 0 -} - -func (m *StakeEntry) GetEndpoints() []Endpoint { - if m != nil { - return m.Endpoints - } - return nil -} - -func (m *StakeEntry) GetGeolocation() int32 { - if m != nil { - return m.Geolocation - } - return 0 -} - -func (m *StakeEntry) GetChain() string { - if m != nil { - return m.Chain - } - return "" -} - -func (m *StakeEntry) GetMoniker() string { - if m != nil { - return m.Moniker - } - return "" -} - -func (m *StakeEntry) GetDelegateTotal() types.Coin { - if m != nil { - return m.DelegateTotal - } - return types.Coin{} -} - -func (m *StakeEntry) GetDelegateLimit() types.Coin { - if m != nil { - return m.DelegateLimit - } - return types.Coin{} -} - -func (m *StakeEntry) GetDelegateCommission() uint64 { - if m != nil { - return m.DelegateCommission - } - return 0 -} - -func (m *StakeEntry) GetLastChange() uint64 { - if m != nil { - return m.LastChange - } - return 0 -} - -func (m *StakeEntry) GetBlockReport() *BlockReport { - if m != nil { - return m.BlockReport - } - return nil -} - -func (m *StakeEntry) GetVault() string { - if m != nil { - return m.Vault - } - return "" -} - -// BlockReport holds the most up-to-date info regarding blocks of the provider -// It is set in the relay payment TX logic -// used by the consumer to calculate the provider's sync score -type BlockReport struct { - Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` - LatestBlock uint64 `protobuf:"varint,2,opt,name=latest_block,json=latestBlock,proto3" json:"latest_block,omitempty"` -} - -func (m *BlockReport) Reset() { *m = BlockReport{} } -func (m *BlockReport) String() string { return proto.CompactTextString(m) } -func (*BlockReport) ProtoMessage() {} -func (*BlockReport) Descriptor() ([]byte, []int) { - return fileDescriptor_df6302d6b53c056e, []int{1} -} -func (m *BlockReport) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BlockReport) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BlockReport.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 *BlockReport) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockReport.Merge(m, src) -} -func (m *BlockReport) XXX_Size() int { - return m.Size() -} -func (m *BlockReport) XXX_DiscardUnknown() { - xxx_messageInfo_BlockReport.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockReport proto.InternalMessageInfo - -func (m *BlockReport) GetEpoch() uint64 { - if m != nil { - return m.Epoch - } - return 0 -} - -func (m *BlockReport) GetLatestBlock() uint64 { - if m != nil { - return m.LatestBlock - } - return 0 -} - -func init() { - proto.RegisterType((*StakeEntry)(nil), "lavanet.lava.epochstorage.StakeEntryV6") - proto.RegisterType((*BlockReport)(nil), "lavanet.lava.epochstorage.BlockReportV6") -} - -func init() { - proto.RegisterFile("lavanet/lava/epochstorage/stake_entry.proto", fileDescriptor_df6302d6b53c056e) -} - -var fileDescriptor_df6302d6b53c056e = []byte{ - // 510 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0x41, 0x6e, 0xdb, 0x3a, - 0x10, 0xb5, 0x12, 0x39, 0xb1, 0x29, 0x27, 0xf8, 0x9f, 0xc9, 0x82, 0xc9, 0x42, 0x51, 0x53, 0xa0, - 0x10, 0xd0, 0x82, 0x42, 0x52, 0xf4, 0x00, 0xb5, 0x11, 0x17, 0x2d, 0xba, 0x52, 0xbb, 0xea, 0xc6, - 0xa0, 0x24, 0x42, 0x26, 0x2c, 0x71, 0x04, 0x91, 0x31, 0x9a, 0x5b, 0xf4, 0x58, 0x59, 0x66, 0xd9, - 0x55, 0x51, 0xd8, 0x27, 0xe8, 0x0d, 0x0a, 0x92, 0x72, 0x12, 0x2f, 0x52, 0xb4, 0x2b, 0x72, 0xe6, - 0xbd, 0x37, 0x98, 0x79, 0xe4, 0xa0, 0x97, 0x15, 0x5b, 0x32, 0xc9, 0x75, 0x62, 0xce, 0x84, 0x37, - 0x90, 0xcf, 0x95, 0x86, 0x96, 0x95, 0x3c, 0x51, 0x9a, 0x2d, 0xf8, 0x8c, 0x4b, 0xdd, 0xde, 0xd0, - 0xa6, 0x05, 0x0d, 0xf8, 0xa4, 0x23, 0x53, 0x73, 0xd2, 0xc7, 0xe4, 0xd3, 0xf8, 0xe9, 0x3a, 0x5c, - 0x16, 0x0d, 0x08, 0xa9, 0x5d, 0x91, 0xd3, 0xe3, 0x12, 0x4a, 0xb0, 0xd7, 0xc4, 0xdc, 0xba, 0x6c, - 0x98, 0x83, 0xaa, 0x41, 0x25, 0x19, 0x53, 0x3c, 0x59, 0x5e, 0x64, 0x5c, 0xb3, 0x8b, 0x24, 0x07, - 0x21, 0x1d, 0x7e, 0xfe, 0xcb, 0x47, 0xe8, 0x93, 0x69, 0xe8, 0xca, 0xf4, 0x83, 0xdf, 0xa0, 0xbe, - 0x6d, 0x8f, 0x78, 0x91, 0x17, 0x07, 0x97, 0x27, 0xd4, 0xc9, 0xa9, 0x91, 0xd3, 0x4e, 0x4e, 0x27, - 0x20, 0xe4, 0xd8, 0xbf, 0xfd, 0x71, 0xd6, 0x4b, 0x1d, 0x1b, 0x13, 0xb4, 0xcf, 0x8a, 0xa2, 0xe5, - 0x4a, 0x91, 0x9d, 0xc8, 0x8b, 0x87, 0xe9, 0x26, 0xc4, 0x14, 0x1d, 0xb9, 0x79, 0x59, 0xd3, 0x54, - 0x82, 0x17, 0xb3, 0xac, 0x82, 0x7c, 0x41, 0x76, 0x23, 0x2f, 0xf6, 0xd3, 0xff, 0x2d, 0xf4, 0xd6, - 0x21, 0x63, 0x03, 0xe0, 0x77, 0x68, 0xb8, 0x99, 0x4b, 0x11, 0x3f, 0xda, 0x8d, 0x83, 0xcb, 0xe7, - 0xf4, 0x49, 0x7b, 0xe8, 0x55, 0xc7, 0xed, 0xda, 0x79, 0xd0, 0xe2, 0x08, 0x05, 0x25, 0x87, 0x0a, - 0x72, 0xa6, 0x05, 0x48, 0xd2, 0x8f, 0xbc, 0xb8, 0x9f, 0x3e, 0x4e, 0xe1, 0x63, 0xd4, 0xcf, 0xe7, - 0x4c, 0x48, 0xb2, 0x67, 0x5b, 0x76, 0x81, 0x19, 0xa5, 0x06, 0x29, 0x16, 0xbc, 0x25, 0x03, 0x37, - 0x4a, 0x17, 0xe2, 0x29, 0x3a, 0x2c, 0x78, 0xc5, 0x4b, 0xa6, 0xf9, 0x4c, 0x83, 0x66, 0x15, 0x19, - 0xfe, 0x9d, 0x49, 0x07, 0x1b, 0xd9, 0x67, 0xa3, 0xda, 0xaa, 0x53, 0x89, 0x5a, 0x68, 0x82, 0xfe, - 0xb1, 0xce, 0x47, 0xa3, 0xc2, 0x09, 0x3a, 0xba, 0xaf, 0x93, 0x43, 0x5d, 0x0b, 0xa5, 0xcc, 0xa4, - 0x81, 0xb5, 0x16, 0x6f, 0xa0, 0xc9, 0x3d, 0x82, 0xcf, 0x50, 0x50, 0x31, 0xa5, 0x67, 0xf9, 0x9c, - 0xc9, 0x92, 0x93, 0x91, 0x25, 0x22, 0x93, 0x9a, 0xd8, 0x0c, 0x7e, 0x8f, 0x46, 0xf6, 0x79, 0x66, - 0x2d, 0x6f, 0xa0, 0xd5, 0xe4, 0xc0, 0xf6, 0xf5, 0xe2, 0x0f, 0xfe, 0xdb, 0x47, 0x4b, 0x2d, 0x3b, - 0x0d, 0xb2, 0x87, 0xc0, 0x98, 0xbb, 0x64, 0xd7, 0x95, 0x26, 0x87, 0xce, 0x5c, 0x1b, 0x7c, 0xf0, - 0x07, 0xfb, 0xff, 0x0d, 0xce, 0xa7, 0x28, 0x18, 0x6f, 0x53, 0x6d, 0x4d, 0xfb, 0xe7, 0xfc, 0xd4, - 0x05, 0xf8, 0x19, 0x1a, 0x55, 0x4c, 0x73, 0xa5, 0xbb, 0x1f, 0xb3, 0x63, 0xc1, 0xc0, 0xe5, 0xac, - 0x7c, 0x3c, 0xbd, 0x5d, 0x85, 0xde, 0xdd, 0x2a, 0xf4, 0x7e, 0xae, 0x42, 0xef, 0xdb, 0x3a, 0xec, - 0xdd, 0xad, 0xc3, 0xde, 0xf7, 0x75, 0xd8, 0xfb, 0xf2, 0xaa, 0x14, 0x7a, 0x7e, 0x9d, 0xd1, 0x1c, - 0xea, 0x64, 0x6b, 0x81, 0xbe, 0x6e, 0xaf, 0x90, 0xbe, 0x69, 0xb8, 0xca, 0xf6, 0xec, 0x2a, 0xbc, - 0xfe, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xc7, 0x25, 0xca, 0x07, 0xb4, 0x03, 0x00, 0x00, -} - -func (m *StakeEntry) 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 *StakeEntry) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StakeEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Vault) > 0 { - i -= len(m.Vault) - copy(dAtA[i:], m.Vault) - i = encodeVarintStakeEntry(dAtA, i, uint64(len(m.Vault))) - i-- - dAtA[i] = 0x72 - } - if m.BlockReport != nil { - { - size, err := m.BlockReport.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStakeEntry(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x6a - } - if m.LastChange != 0 { - i = encodeVarintStakeEntry(dAtA, i, uint64(m.LastChange)) - i-- - dAtA[i] = 0x60 - } - if m.DelegateCommission != 0 { - i = encodeVarintStakeEntry(dAtA, i, uint64(m.DelegateCommission)) - i-- - dAtA[i] = 0x58 - } - { - size, err := m.DelegateLimit.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStakeEntry(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - { - size, err := m.DelegateTotal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStakeEntry(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - if len(m.Moniker) > 0 { - i -= len(m.Moniker) - copy(dAtA[i:], m.Moniker) - i = encodeVarintStakeEntry(dAtA, i, uint64(len(m.Moniker))) - i-- - dAtA[i] = 0x42 - } - if len(m.Chain) > 0 { - i -= len(m.Chain) - copy(dAtA[i:], m.Chain) - i = encodeVarintStakeEntry(dAtA, i, uint64(len(m.Chain))) - i-- - dAtA[i] = 0x32 - } - if m.Geolocation != 0 { - i = encodeVarintStakeEntry(dAtA, i, uint64(m.Geolocation)) - i-- - dAtA[i] = 0x28 - } - if len(m.Endpoints) > 0 { - for iNdEx := len(m.Endpoints) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Endpoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStakeEntry(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.StakeAppliedBlock != 0 { - i = encodeVarintStakeEntry(dAtA, i, uint64(m.StakeAppliedBlock)) - i-- - dAtA[i] = 0x18 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintStakeEntry(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Stake.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStakeEntry(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *BlockReport) 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 *BlockReport) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BlockReport) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LatestBlock != 0 { - i = encodeVarintStakeEntry(dAtA, i, uint64(m.LatestBlock)) - i-- - dAtA[i] = 0x10 - } - if m.Epoch != 0 { - i = encodeVarintStakeEntry(dAtA, i, uint64(m.Epoch)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintStakeEntry(dAtA []byte, offset int, v uint64) int { - offset -= sovStakeEntry(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *StakeEntry) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Stake.Size() - n += 1 + l + sovStakeEntry(uint64(l)) - l = len(m.Address) - if l > 0 { - n += 1 + l + sovStakeEntry(uint64(l)) - } - if m.StakeAppliedBlock != 0 { - n += 1 + sovStakeEntry(uint64(m.StakeAppliedBlock)) - } - if len(m.Endpoints) > 0 { - for _, e := range m.Endpoints { - l = e.Size() - n += 1 + l + sovStakeEntry(uint64(l)) - } - } - if m.Geolocation != 0 { - n += 1 + sovStakeEntry(uint64(m.Geolocation)) - } - l = len(m.Chain) - if l > 0 { - n += 1 + l + sovStakeEntry(uint64(l)) - } - l = len(m.Moniker) - if l > 0 { - n += 1 + l + sovStakeEntry(uint64(l)) - } - l = m.DelegateTotal.Size() - n += 1 + l + sovStakeEntry(uint64(l)) - l = m.DelegateLimit.Size() - n += 1 + l + sovStakeEntry(uint64(l)) - if m.DelegateCommission != 0 { - n += 1 + sovStakeEntry(uint64(m.DelegateCommission)) - } - if m.LastChange != 0 { - n += 1 + sovStakeEntry(uint64(m.LastChange)) - } - if m.BlockReport != nil { - l = m.BlockReport.Size() - n += 1 + l + sovStakeEntry(uint64(l)) - } - l = len(m.Vault) - if l > 0 { - n += 1 + l + sovStakeEntry(uint64(l)) - } - return n -} - -func (m *BlockReport) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Epoch != 0 { - n += 1 + sovStakeEntry(uint64(m.Epoch)) - } - if m.LatestBlock != 0 { - n += 1 + sovStakeEntry(uint64(m.LatestBlock)) - } - return n -} - -func sovStakeEntry(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozStakeEntry(x uint64) (n int) { - return sovStakeEntry(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *StakeEntry) 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 ErrIntOverflowStakeEntry - } - 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: StakeEntry: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StakeEntry: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Stake", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStakeEntry - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStakeEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Stake.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthStakeEntry - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStakeEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeAppliedBlock", wireType) - } - m.StakeAppliedBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StakeAppliedBlock |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Endpoints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStakeEntry - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStakeEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Endpoints = append(m.Endpoints, Endpoint{}) - if err := m.Endpoints[len(m.Endpoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Geolocation", wireType) - } - m.Geolocation = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Geolocation |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Chain", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthStakeEntry - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStakeEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Chain = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthStakeEntry - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStakeEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Moniker = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegateTotal", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStakeEntry - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStakeEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.DelegateTotal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegateLimit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStakeEntry - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStakeEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.DelegateLimit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegateCommission", wireType) - } - m.DelegateCommission = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DelegateCommission |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LastChange", wireType) - } - m.LastChange = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LastChange |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockReport", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStakeEntry - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStakeEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.BlockReport == nil { - m.BlockReport = &BlockReport{} - } - if err := m.BlockReport.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Vault", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthStakeEntry - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStakeEntry - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Vault = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStakeEntry(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthStakeEntry - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BlockReport) 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 ErrIntOverflowStakeEntry - } - 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: BlockReport: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BlockReport: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Epoch", wireType) - } - m.Epoch = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Epoch |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LatestBlock", wireType) - } - m.LatestBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LatestBlock |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipStakeEntry(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthStakeEntry - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipStakeEntry(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStakeEntry - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthStakeEntry - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupStakeEntry - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthStakeEntry - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthStakeEntry = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowStakeEntry = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupStakeEntry = fmt.Errorf("proto: unexpected end of group") -) \ No newline at end of file diff --git a/x/epochstorage/types/migrations/v6/stake_storage.pb.go b/x/epochstorage/types/migrations/v6/stake_storage.pb.go deleted file mode 100644 index bf34c57f4b..0000000000 --- a/x/epochstorage/types/migrations/v6/stake_storage.pb.go +++ /dev/null @@ -1,438 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: lavanet/lava/epochstorage/stake_storage.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type StakeStorage struct { - Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` - StakeEntries []StakeEntry `protobuf:"bytes,2,rep,name=stakeEntries,proto3" json:"stakeEntries"` - EpochBlockHash []byte `protobuf:"bytes,3,opt,name=epochBlockHash,proto3" json:"epochBlockHash,omitempty"` -} - -func (m *StakeStorage) Reset() { *m = StakeStorage{} } -func (m *StakeStorage) String() string { return proto.CompactTextString(m) } -func (*StakeStorage) ProtoMessage() {} -func (*StakeStorage) Descriptor() ([]byte, []int) { - return fileDescriptor_be7b78aecc265fd4, []int{0} -} -func (m *StakeStorage) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StakeStorage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StakeStorage.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 *StakeStorage) XXX_Merge(src proto.Message) { - xxx_messageInfo_StakeStorage.Merge(m, src) -} -func (m *StakeStorage) XXX_Size() int { - return m.Size() -} -func (m *StakeStorage) XXX_DiscardUnknown() { - xxx_messageInfo_StakeStorage.DiscardUnknown(m) -} - -var xxx_messageInfo_StakeStorage proto.InternalMessageInfo - -func (m *StakeStorage) GetIndex() string { - if m != nil { - return m.Index - } - return "" -} - -func (m *StakeStorage) GetStakeEntries() []StakeEntry { - if m != nil { - return m.StakeEntries - } - return nil -} - -func (m *StakeStorage) GetEpochBlockHash() []byte { - if m != nil { - return m.EpochBlockHash - } - return nil -} - -func init() { - proto.RegisterType((*StakeStorage)(nil), "lavanet.lava.epochstorage.StakeStorageV6") -} - -func init() { - proto.RegisterFile("lavanet/lava/epochstorage/stake_storage.proto", fileDescriptor_be7b78aecc265fd4) -} - -var fileDescriptor_be7b78aecc265fd4 = []byte{ - // 246 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xcd, 0x49, 0x2c, 0x4b, - 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0xa9, 0x05, 0xf9, 0xc9, 0x19, 0xc5, 0x25, 0xf9, 0x45, - 0x89, 0xe9, 0xa9, 0xfa, 0xc5, 0x25, 0x89, 0xd9, 0xa9, 0xf1, 0x50, 0x9e, 0x5e, 0x41, 0x51, 0x7e, - 0x49, 0xbe, 0x90, 0x24, 0x54, 0xb9, 0x1e, 0x88, 0xd6, 0x43, 0x56, 0x2e, 0xa5, 0x4d, 0xc8, 0xa4, - 0xd4, 0xbc, 0x92, 0xa2, 0x4a, 0x88, 0x39, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, - 0x88, 0x05, 0x11, 0x55, 0x9a, 0xcb, 0xc8, 0xc5, 0x13, 0x0c, 0x52, 0x1b, 0x0c, 0xd1, 0x28, 0x24, - 0xc2, 0xc5, 0x9a, 0x99, 0x97, 0x92, 0x5a, 0x21, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x19, 0x04, 0xe1, - 0x08, 0xf9, 0x73, 0xf1, 0x80, 0x4d, 0x74, 0xcd, 0x2b, 0x29, 0xca, 0x4c, 0x2d, 0x96, 0x60, 0x52, - 0x60, 0xd6, 0xe0, 0x36, 0x52, 0xd5, 0xc3, 0xe9, 0x36, 0xbd, 0x60, 0x98, 0xf2, 0x4a, 0x27, 0x96, - 0x13, 0xf7, 0xe4, 0x19, 0x82, 0x50, 0x0c, 0x10, 0x52, 0xe3, 0xe2, 0x03, 0x2b, 0x77, 0xca, 0xc9, - 0x4f, 0xce, 0xf6, 0x48, 0x2c, 0xce, 0x90, 0x60, 0x56, 0x60, 0xd4, 0xe0, 0x09, 0x42, 0x13, 0x75, - 0x72, 0x3b, 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, 0x9d, 0xf4, 0xcc, 0x92, - 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x94, 0x70, 0xa8, 0x40, 0x0d, 0x89, 0x92, 0xca, - 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x77, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x64, 0x2d, - 0xbc, 0x7a, 0x7d, 0x01, 0x00, 0x00, -} - -func (m *StakeStorage) 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 *StakeStorage) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StakeStorage) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.EpochBlockHash) > 0 { - i -= len(m.EpochBlockHash) - copy(dAtA[i:], m.EpochBlockHash) - i = encodeVarintStakeStorage(dAtA, i, uint64(len(m.EpochBlockHash))) - i-- - dAtA[i] = 0x1a - } - if len(m.StakeEntries) > 0 { - for iNdEx := len(m.StakeEntries) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.StakeEntries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStakeStorage(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Index) > 0 { - i -= len(m.Index) - copy(dAtA[i:], m.Index) - i = encodeVarintStakeStorage(dAtA, i, uint64(len(m.Index))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintStakeStorage(dAtA []byte, offset int, v uint64) int { - offset -= sovStakeStorage(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *StakeStorage) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Index) - if l > 0 { - n += 1 + l + sovStakeStorage(uint64(l)) - } - if len(m.StakeEntries) > 0 { - for _, e := range m.StakeEntries { - l = e.Size() - n += 1 + l + sovStakeStorage(uint64(l)) - } - } - l = len(m.EpochBlockHash) - if l > 0 { - n += 1 + l + sovStakeStorage(uint64(l)) - } - return n -} - -func sovStakeStorage(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozStakeStorage(x uint64) (n int) { - return sovStakeStorage(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *StakeStorage) 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 ErrIntOverflowStakeStorage - } - 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: StakeStorage: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StakeStorage: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeStorage - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthStakeStorage - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthStakeStorage - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Index = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StakeEntries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeStorage - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStakeStorage - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStakeStorage - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.StakeEntries = append(m.StakeEntries, StakeEntry{}) - if err := m.StakeEntries[len(m.StakeEntries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochBlockHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakeStorage - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthStakeStorage - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthStakeStorage - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EpochBlockHash = append(m.EpochBlockHash[:0], dAtA[iNdEx:postIndex]...) - if m.EpochBlockHash == nil { - m.EpochBlockHash = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStakeStorage(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthStakeStorage - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipStakeStorage(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStakeStorage - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStakeStorage - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStakeStorage - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthStakeStorage - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupStakeStorage - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthStakeStorage - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthStakeStorage = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowStakeStorage = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupStakeStorage = fmt.Errorf("proto: unexpected end of group") -) \ No newline at end of file diff --git a/x/pairing/module_simulation.go b/x/pairing/module_simulation.go deleted file mode 100644 index 2d2e31c970..0000000000 --- a/x/pairing/module_simulation.go +++ /dev/null @@ -1,184 +0,0 @@ -package pairing - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - types2 "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/v4/testutil/sample" - pairingsimulation "github.com/lavanet/lava/v4/x/pairing/simulation" - "github.com/lavanet/lava/v4/x/pairing/types" -) - -// avoid unused import issue -var ( - _ = sample.AccAddress - _ = pairingsimulation.FindAccount - _ = sims.StakePerAccount - _ = simulation.MsgEntryKind - _ = baseapp.Paramspace -) - -const ( - opWeightMsgStakeProvider = "op_weight_msg_stake_provider" - // TODO: Determine the simulation weight value - defaultWeightMsgStakeProvider int = 100 - - opWeightMsgStakeClient = "op_weight_msg_stake_client" - // TODO: Determine the simulation weight value - defaultWeightMsgStakeClient int = 100 - - opWeightMsgUnstakeProvider = "op_weight_msg_unstake_provider" - // TODO: Determine the simulation weight value - defaultWeightMsgUnstakeProvider int = 100 - - opWeightMsgUnstakeClient = "op_weight_msg_unstake_client" - // TODO: Determine the simulation weight value - defaultWeightMsgUnstakeClient int = 100 - - opWeightMsgRelayPayment = "op_weight_msg_relay_payment" - // TODO: Determine the simulation weight value - defaultWeightMsgRelayPayment int = 100 - - opWeightMsgFreeze = "op_weight_msg_freeze" - // TODO: Determine the simulation weight value - defaultWeightMsgFreeze int = 100 - - opWeightMsgUnfreeze = "op_weight_msg_unfreeze" - // TODO: Determine the simulation weight value - defaultWeightMsgUnfreeze int = 100 - - // this line is used by starport scaffolding # simapp/module/const -) - -// GenerateGenesisState creates a randomized GenState of the module -func (AppModule) GenerateGenesisState(simState *module.SimulationState) { - accs := make([]string, len(simState.Accounts)) - for i, acc := range simState.Accounts { - accs[i] = acc.Address.String() - } - pairingGenesis := types.GenesisState{ - Params: types.DefaultParams(), - // this line is used by starport scaffolding # simapp/module/genesisState - } - simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&pairingGenesis) -} - -// ProposalContents doesn't return any content functions for governance proposals -func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalMsg { - return nil -} - -// TODO: Add weighted proposals -func (AppModule) ProposalMsgs(_ module.SimulationState) []simtypes.WeightedProposalMsg { - return []simtypes.WeightedProposalMsg{ - simulation.NewWeightedProposalMsg("op_weight_msg_update_params", 100, func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { - return &types2.MsgUpdateParams{} - }), - } -} - -//// RandomizedParams creates randomized param changes for the simulator -// func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { -// pairingParams := types.DefaultParams() -// return []simtypes.ParamChange{ -// simulation.NewSimParamChange(types.ModuleName, string(types.KeyFraudStakeSlashingFactor), func(r *rand.Rand) string { -// return string(types.Amino.MustMarshalJSON(pairingParams.FraudStakeSlashingFactor)) -// }), -// simulation.NewSimParamChange(types.ModuleName, string(types.KeyFraudSlashingAmount), func(r *rand.Rand) string { -// return string(types.Amino.MustMarshalJSON(pairingParams.FraudSlashingAmount)) -// }), -// simulation.NewSimParamChange(types.ModuleName, string(types.KeyEpochBlocksOverlap), func(r *rand.Rand) string { -// return string(types.Amino.MustMarshalJSON(pairingParams.EpochBlocksOverlap)) -// }), -// simulation.NewSimParamChange(types.ModuleName, string(types.KeyRecommendedEpochNumToCollectPayment), func(r *rand.Rand) string { -// return string(types.Amino.MustMarshalJSON(pairingParams.RecommendedEpochNumToCollectPayment)) -// }), -// } -// } - -// RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} - -// WeightedOperations returns the all the gov module operations with their respective weights. -func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { - operations := make([]simtypes.WeightedOperation, 0) - - var weightMsgStakeProvider int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgStakeProvider, &weightMsgStakeProvider, nil, - func(_ *rand.Rand) { - weightMsgStakeProvider = defaultWeightMsgStakeProvider - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgStakeProvider, - pairingsimulation.SimulateMsgStakeProvider(am.accountKeeper, am.bankKeeper, am.keeper), - )) - - var weightMsgStakeClient int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgStakeClient, &weightMsgStakeClient, nil, - func(_ *rand.Rand) { - weightMsgStakeClient = defaultWeightMsgStakeClient - }, - ) - - var weightMsgUnstakeProvider int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgUnstakeProvider, &weightMsgUnstakeProvider, nil, - func(_ *rand.Rand) { - weightMsgUnstakeProvider = defaultWeightMsgUnstakeProvider - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgUnstakeProvider, - pairingsimulation.SimulateMsgUnstakeProvider(am.accountKeeper, am.bankKeeper, am.keeper), - )) - - var weightMsgUnstakeClient int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgUnstakeClient, &weightMsgUnstakeClient, nil, - func(_ *rand.Rand) { - weightMsgUnstakeClient = defaultWeightMsgUnstakeClient - }, - ) - - var weightMsgRelayPayment int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgRelayPayment, &weightMsgRelayPayment, nil, - func(_ *rand.Rand) { - weightMsgRelayPayment = defaultWeightMsgRelayPayment - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgRelayPayment, - pairingsimulation.SimulateMsgRelayPayment(am.accountKeeper, am.bankKeeper, am.keeper), - )) - - var weightMsgFreeze int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgFreeze, &weightMsgFreeze, nil, - func(_ *rand.Rand) { - weightMsgFreeze = defaultWeightMsgFreeze - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgFreeze, - pairingsimulation.SimulateMsgFreeze(am.accountKeeper, am.bankKeeper, am.keeper), - )) - - var weightMsgUnfreeze int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgUnfreeze, &weightMsgUnfreeze, nil, - func(_ *rand.Rand) { - weightMsgUnfreeze = defaultWeightMsgUnfreeze - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgUnfreeze, - pairingsimulation.SimulateMsgUnfreeze(am.accountKeeper, am.bankKeeper, am.keeper), - )) - - // this line is used by starport scaffolding # simapp/module/operation - - return operations -} diff --git a/x/pairing/simulation/freeze.go b/x/pairing/simulation/freeze.go deleted file mode 100644 index c583ddb917..0000000000 --- a/x/pairing/simulation/freeze.go +++ /dev/null @@ -1,29 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v4/x/pairing/keeper" - "github.com/lavanet/lava/v4/x/pairing/types" -) - -func SimulateMsgFreeze( - ak types.AccountKeeper, - bk types.BankKeeper, - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - msg := &types.MsgFreezeProvider{ - Creator: simAccount.Address.String(), - } - - // TODO: Handling the Freeze simulation - - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "Freeze simulation not implemented"), nil, nil - } -} diff --git a/x/pairing/simulation/relay_payment.go b/x/pairing/simulation/relay_payment.go deleted file mode 100644 index 6cd2b08a8d..0000000000 --- a/x/pairing/simulation/relay_payment.go +++ /dev/null @@ -1,29 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v4/x/pairing/keeper" - "github.com/lavanet/lava/v4/x/pairing/types" -) - -func SimulateMsgRelayPayment( - ak types.AccountKeeper, - bk types.BankKeeper, - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - msg := &types.MsgRelayPayment{ - Creator: simAccount.Address.String(), - } - - // TODO: Handling the RelayPayment simulation - - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "RelayPayment simulation not implemented"), nil, nil - } -} diff --git a/x/pairing/simulation/simap.go b/x/pairing/simulation/simap.go deleted file mode 100644 index 92c437c0d1..0000000000 --- a/x/pairing/simulation/simap.go +++ /dev/null @@ -1,15 +0,0 @@ -package simulation - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" -) - -// FindAccount find a specific address from an account list -func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { - creator, err := sdk.AccAddressFromBech32(address) - if err != nil { - panic(err) - } - return simtypes.FindAccount(accs, creator) -} diff --git a/x/pairing/simulation/stake_provider.go b/x/pairing/simulation/stake_provider.go deleted file mode 100644 index 0eece3809b..0000000000 --- a/x/pairing/simulation/stake_provider.go +++ /dev/null @@ -1,45 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v4/x/pairing/keeper" - "github.com/lavanet/lava/v4/x/pairing/types" -) - -func SimulateMsgStakeProvider( - ak types.AccountKeeper, - bk types.BankKeeper, - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - msg := &types.MsgStakeProvider{ - Creator: simAccount.Address.String(), - } - - // TODO: Handling the StakeProvider simulation - - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "StakeProvider simulation not implemented"), nil, nil - } -} - -func SimulateMsgStakeProvider_HappyFlow( - ak types.AccountKeeper, - bk types.BankKeeper, - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - msg := &types.MsgStakeProvider{ - Creator: simAccount.Address.String(), - } - - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "StakeProvider simulation not implemented"), nil, nil - } -} diff --git a/x/pairing/simulation/unfreeze.go b/x/pairing/simulation/unfreeze.go deleted file mode 100644 index 77256d7b20..0000000000 --- a/x/pairing/simulation/unfreeze.go +++ /dev/null @@ -1,29 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v4/x/pairing/keeper" - "github.com/lavanet/lava/v4/x/pairing/types" -) - -func SimulateMsgUnfreeze( - ak types.AccountKeeper, - bk types.BankKeeper, - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - msg := &types.MsgUnfreezeProvider{ - Creator: simAccount.Address.String(), - } - - // TODO: Handling the Unfreeze simulation - - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "Unfreeze simulation not implemented"), nil, nil - } -} diff --git a/x/pairing/simulation/unstake_provider.go b/x/pairing/simulation/unstake_provider.go deleted file mode 100644 index 71f79e812a..0000000000 --- a/x/pairing/simulation/unstake_provider.go +++ /dev/null @@ -1,29 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v4/x/pairing/keeper" - "github.com/lavanet/lava/v4/x/pairing/types" -) - -func SimulateMsgUnstakeProvider( - ak types.AccountKeeper, - bk types.BankKeeper, - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - msg := &types.MsgUnstakeProvider{ - Creator: simAccount.Address.String(), - } - - // TODO: Handling the UnstakeProvider simulation - - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "UnstakeProvider simulation not implemented"), nil, nil - } -} diff --git a/x/plans/keeper/migrations.go b/x/plans/keeper/migrations.go index 4aba7e497f..aa296391d1 100644 --- a/x/plans/keeper/migrations.go +++ b/x/plans/keeper/migrations.go @@ -4,11 +4,8 @@ import ( "math" sdk "github.com/cosmos/cosmos-sdk/types" - v2 "github.com/lavanet/lava/v4/x/plans/migrations/v2" - v3 "github.com/lavanet/lava/v4/x/plans/migrations/v3" v7 "github.com/lavanet/lava/v4/x/plans/migrations/v7" v8 "github.com/lavanet/lava/v4/x/plans/migrations/v8" - projectsv3 "github.com/lavanet/lava/v4/x/projects/migrations/v3" ) type Migrator struct { @@ -19,80 +16,6 @@ func NewMigrator(keeper Keeper) Migrator { return Migrator{keeper: keeper} } -// Migrate2to3 implements store migration from v1 to v2: -// - Trigger the version upgrade of the planFS fixation store -// - Update plan policy -func (m Migrator) Migrate2to3(ctx sdk.Context) error { - planIndices := m.keeper.plansFS.AllEntryIndicesFilter(ctx, "", nil) - - for _, planIndex := range planIndices { - blocks := m.keeper.plansFS.GetAllEntryVersions(ctx, planIndex) - for _, block := range blocks { - var plan_v2 v2.Plan - m.keeper.plansFS.ReadEntry(ctx, planIndex, block, &plan_v2) - - // create policy struct - planPolicy := projectsv3.Policy{ - GeolocationProfile: uint64(1), - TotalCuLimit: plan_v2.ComputeUnits, - EpochCuLimit: plan_v2.ComputeUnitsPerEpoch, - MaxProvidersToPair: plan_v2.MaxProvidersToPair, - } - - // convert plan from type v2.Plan to types.Plan - plan_v3 := v3.Plan{ - Index: plan_v2.Index, - Block: plan_v2.Block, - Price: plan_v2.Price, - OveruseRate: plan_v2.OveruseRate, - AllowOveruse: plan_v2.AllowOveruse, - Description: plan_v2.Description, - Type: plan_v2.Type, - AnnualDiscountPercentage: plan_v2.AnnualDiscountPercentage, - PlanPolicy: planPolicy, - } - - m.keeper.plansFS.ModifyEntry(ctx, planIndex, block, &plan_v3) - } - } - - return nil -} - -// Migrate3to4 implements store migration from v3 to v4: -// - Trigger the version upgrade of the planFS fixation store -// - Replace the store prefix from module-name ("plan") to "plan-fs" -func (m Migrator) Migrate3to4(ctx sdk.Context) error { - // This migration used to call a deprecated fixationstore function called MigrateVersionAndPrefix - - return nil -} - -// Migrate4to5 implements store migration from v4 to v5: -// - Trigger the version upgrade of the planFS fixation store (so it will -// call the version upgrade of its timer store). -func (m Migrator) Migrate4to5(ctx sdk.Context) error { - // This migration used to call a deprecated fixationstore function called MigrateVersion - - return nil -} - -// Migrate5to6 implements store migration from v5 to v6: -// -- trigger fixation migration, deleteat and live variables -func (m Migrator) Migrate5to6(ctx sdk.Context) error { - // This migration used to call a deprecated fixationstore function called MigrateVersion - - return nil -} - -// Migrate6to7 implements store migration from v6 to v7: -// -- trigger fixation migration (v4->v5), initialize IsLatest field -func (m Migrator) Migrate6to7(ctx sdk.Context) error { - // This migration used to call a deprecated fixationstore function called MigrateVersion - - return nil -} - func (m Migrator) Migrate7to8(ctx sdk.Context) error { plansInds := m.keeper.plansFS.GetAllEntryIndices(ctx) for _, ind := range plansInds { diff --git a/x/plans/migrations/v2/plan.pb.go b/x/plans/migrations/v2/plan.pb.go deleted file mode 100755 index a2f4d3f7ce..0000000000 --- a/x/plans/migrations/v2/plan.pb.go +++ /dev/null @@ -1,794 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: plans/plan.proto - -package v2 - -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" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Plan struct { - Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` - Block uint64 `protobuf:"varint,3,opt,name=block,proto3" json:"block,omitempty"` - Price types.Coin `protobuf:"bytes,4,opt,name=price,proto3" json:"price"` - ComputeUnits uint64 `protobuf:"varint,5,opt,name=compute_units,json=computeUnits,proto3" json:"compute_units,omitempty"` - ComputeUnitsPerEpoch uint64 `protobuf:"varint,6,opt,name=compute_units_per_epoch,json=computeUnitsPerEpoch,proto3" json:"compute_units_per_epoch,omitempty"` - MaxProvidersToPair uint64 `protobuf:"varint,7,opt,name=max_providers_to_pair,json=maxProvidersToPair,proto3" json:"max_providers_to_pair,omitempty"` - AllowOveruse bool `protobuf:"varint,8,opt,name=allow_overuse,json=allowOveruse,proto3" json:"allow_overuse,omitempty"` - OveruseRate uint64 `protobuf:"varint,9,opt,name=overuse_rate,json=overuseRate,proto3" json:"overuse_rate,omitempty"` - Description string `protobuf:"bytes,11,opt,name=description,proto3" json:"description,omitempty"` - Type string `protobuf:"bytes,12,opt,name=type,proto3" json:"type,omitempty"` - AnnualDiscountPercentage uint64 `protobuf:"varint,13,opt,name=annual_discount_percentage,json=annualDiscountPercentage,proto3" json:"annual_discount_percentage,omitempty"` -} - -func (m *Plan) Reset() { *m = Plan{} } -func (m *Plan) String() string { return proto.CompactTextString(m) } -func (*Plan) ProtoMessage() {} -func (*Plan) Descriptor() ([]byte, []int) { - return fileDescriptor_e5909a10cd0e3497, []int{0} -} -func (m *Plan) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Plan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Plan.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 *Plan) XXX_Merge(src proto.Message) { - xxx_messageInfo_Plan.Merge(m, src) -} -func (m *Plan) XXX_Size() int { - return m.Size() -} -func (m *Plan) XXX_DiscardUnknown() { - xxx_messageInfo_Plan.DiscardUnknown(m) -} - -var xxx_messageInfo_Plan proto.InternalMessageInfo - -func (m *Plan) GetIndex() string { - if m != nil { - return m.Index - } - return "" -} - -func (m *Plan) GetBlock() uint64 { - if m != nil { - return m.Block - } - return 0 -} - -func (m *Plan) GetPrice() types.Coin { - if m != nil { - return m.Price - } - return types.Coin{} -} - -func (m *Plan) GetComputeUnits() uint64 { - if m != nil { - return m.ComputeUnits - } - return 0 -} - -func (m *Plan) GetComputeUnitsPerEpoch() uint64 { - if m != nil { - return m.ComputeUnitsPerEpoch - } - return 0 -} - -func (m *Plan) GetMaxProvidersToPair() uint64 { - if m != nil { - return m.MaxProvidersToPair - } - return 0 -} - -func (m *Plan) GetAllowOveruse() bool { - if m != nil { - return m.AllowOveruse - } - return false -} - -func (m *Plan) GetOveruseRate() uint64 { - if m != nil { - return m.OveruseRate - } - return 0 -} - -func (m *Plan) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *Plan) GetType() string { - if m != nil { - return m.Type - } - return "" -} - -func (m *Plan) GetAnnualDiscountPercentage() uint64 { - if m != nil { - return m.AnnualDiscountPercentage - } - return 0 -} - -func init() { - proto.RegisterType((*Plan)(nil), "lavanet.lava.plans.PlanV2") -} - -func init() { proto.RegisterFile("plans/plan.proto", fileDescriptor_e5909a10cd0e3497) } - -var fileDescriptor_e5909a10cd0e3497 = []byte{ - // 437 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x52, 0xc1, 0x8e, 0xd3, 0x30, - 0x10, 0x6d, 0x68, 0xba, 0x74, 0x9d, 0xae, 0x54, 0x59, 0x45, 0x98, 0x1e, 0x42, 0x00, 0x21, 0xf5, - 0x94, 0xa8, 0xa0, 0xbd, 0x71, 0xda, 0x85, 0xcb, 0x5e, 0x88, 0x22, 0xb8, 0x70, 0xb1, 0x1c, 0xd7, - 0xea, 0x5a, 0x24, 0x1e, 0xcb, 0x76, 0x4a, 0xf9, 0x0b, 0x3e, 0x83, 0xcf, 0xe0, 0xb8, 0xc7, 0x3d, - 0x72, 0x42, 0xa8, 0xfd, 0x11, 0x64, 0x27, 0xa0, 0x72, 0xf1, 0xcc, 0xbc, 0xf7, 0x3c, 0x6f, 0x6c, - 0x0d, 0x9a, 0xeb, 0x86, 0x29, 0x5b, 0xf8, 0x33, 0xd7, 0x06, 0x1c, 0x60, 0xdc, 0xb0, 0x1d, 0x53, - 0xc2, 0xe5, 0x3e, 0xe6, 0x81, 0x5e, 0x2e, 0xb6, 0xb0, 0x85, 0x40, 0x17, 0x3e, 0xeb, 0x95, 0xcb, - 0x94, 0x83, 0x6d, 0xc1, 0x16, 0x35, 0xb3, 0xa2, 0xd8, 0xad, 0x6b, 0xe1, 0xd8, 0xba, 0xe0, 0x20, - 0x87, 0x4e, 0xcf, 0x7f, 0x8c, 0x51, 0x5c, 0x36, 0x4c, 0xe1, 0x05, 0x9a, 0x48, 0xb5, 0x11, 0x7b, - 0x12, 0x65, 0xd1, 0xea, 0xbc, 0xea, 0x0b, 0x8f, 0xd6, 0x0d, 0xf0, 0xcf, 0x64, 0x9c, 0x45, 0xab, - 0xb8, 0xea, 0x0b, 0x7c, 0x89, 0x26, 0xda, 0x48, 0x2e, 0x48, 0x9c, 0x45, 0xab, 0xe4, 0xd5, 0x93, - 0xbc, 0x37, 0xc9, 0xbd, 0x49, 0x3e, 0x98, 0xe4, 0xd7, 0x20, 0xd5, 0x55, 0x7c, 0xf7, 0xeb, 0xe9, - 0xa8, 0xea, 0xd5, 0xf8, 0x05, 0xba, 0xe0, 0xd0, 0xea, 0xce, 0x09, 0xda, 0x29, 0xe9, 0x2c, 0x99, - 0x84, 0xa6, 0xb3, 0x01, 0xfc, 0xe8, 0x31, 0x7c, 0x89, 0x1e, 0xff, 0x27, 0xa2, 0x5a, 0x18, 0x2a, - 0x34, 0xf0, 0x5b, 0x72, 0x16, 0xe4, 0x8b, 0x53, 0x79, 0x29, 0xcc, 0x3b, 0xcf, 0xe1, 0x35, 0x7a, - 0xd4, 0xb2, 0x3d, 0xd5, 0x06, 0x76, 0x72, 0x23, 0x8c, 0xa5, 0x0e, 0xa8, 0x66, 0xd2, 0x90, 0x87, - 0xe1, 0x12, 0x6e, 0xd9, 0xbe, 0xfc, 0xcb, 0x7d, 0x80, 0x92, 0x49, 0xe3, 0xc7, 0x61, 0x4d, 0x03, - 0x5f, 0x28, 0xec, 0x84, 0xe9, 0xac, 0x20, 0xd3, 0x2c, 0x5a, 0x4d, 0xab, 0x59, 0x00, 0xdf, 0xf7, - 0x18, 0x7e, 0x86, 0x66, 0x03, 0x4d, 0x0d, 0x73, 0x82, 0x9c, 0x87, 0x76, 0xc9, 0x80, 0x55, 0xcc, - 0x09, 0x9c, 0xa1, 0x64, 0x23, 0x2c, 0x37, 0x52, 0x3b, 0x09, 0x8a, 0x24, 0xe1, 0xff, 0x4e, 0x21, - 0x8c, 0x51, 0xec, 0xbe, 0x6a, 0x41, 0x66, 0x81, 0x0a, 0x39, 0x7e, 0x83, 0x96, 0x4c, 0xa9, 0x8e, - 0x35, 0x74, 0x23, 0x2d, 0x87, 0x4e, 0x39, 0xff, 0x52, 0x2e, 0x94, 0x63, 0x5b, 0x41, 0x2e, 0x82, - 0x0d, 0xe9, 0x15, 0x6f, 0x07, 0x41, 0xf9, 0x8f, 0xbf, 0x89, 0xa7, 0x68, 0x9e, 0xdc, 0xc4, 0xd3, - 0x07, 0xf3, 0xf1, 0xd5, 0xf5, 0xf7, 0x43, 0x1a, 0xdd, 0x1d, 0xd2, 0xe8, 0xfe, 0x90, 0x46, 0xbf, - 0x0f, 0x69, 0xf4, 0xed, 0x98, 0x8e, 0xee, 0x8f, 0xe9, 0xe8, 0xe7, 0x31, 0x1d, 0x7d, 0x7a, 0xb9, - 0x95, 0xee, 0xb6, 0xab, 0x73, 0x0e, 0x6d, 0x31, 0x6c, 0x4d, 0x88, 0xc5, 0xbe, 0xe8, 0xd7, 0xca, - 0x4f, 0x63, 0xeb, 0xb3, 0xb0, 0x0e, 0xaf, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x19, 0x0a, 0x79, - 0xc2, 0x6c, 0x02, 0x00, 0x00, -} - -func (this *Plan) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Plan) - if !ok { - that2, ok := that.(Plan) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Index != that1.Index { - return false - } - if this.Block != that1.Block { - return false - } - if !this.Price.Equal(&that1.Price) { - return false - } - if this.ComputeUnits != that1.ComputeUnits { - return false - } - if this.ComputeUnitsPerEpoch != that1.ComputeUnitsPerEpoch { - return false - } - if this.MaxProvidersToPair != that1.MaxProvidersToPair { - return false - } - if this.AllowOveruse != that1.AllowOveruse { - return false - } - if this.OveruseRate != that1.OveruseRate { - return false - } - if this.Description != that1.Description { - return false - } - if this.Type != that1.Type { - return false - } - if this.AnnualDiscountPercentage != that1.AnnualDiscountPercentage { - return false - } - return true -} -func (m *Plan) 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 *Plan) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Plan) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AnnualDiscountPercentage != 0 { - i = encodeVarintPlan(dAtA, i, uint64(m.AnnualDiscountPercentage)) - i-- - dAtA[i] = 0x68 - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintPlan(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0x62 - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintPlan(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x5a - } - if m.OveruseRate != 0 { - i = encodeVarintPlan(dAtA, i, uint64(m.OveruseRate)) - i-- - dAtA[i] = 0x48 - } - if m.AllowOveruse { - i-- - if m.AllowOveruse { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 - } - if m.MaxProvidersToPair != 0 { - i = encodeVarintPlan(dAtA, i, uint64(m.MaxProvidersToPair)) - i-- - dAtA[i] = 0x38 - } - if m.ComputeUnitsPerEpoch != 0 { - i = encodeVarintPlan(dAtA, i, uint64(m.ComputeUnitsPerEpoch)) - i-- - dAtA[i] = 0x30 - } - if m.ComputeUnits != 0 { - i = encodeVarintPlan(dAtA, i, uint64(m.ComputeUnits)) - i-- - dAtA[i] = 0x28 - } - { - size, err := m.Price.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPlan(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if m.Block != 0 { - i = encodeVarintPlan(dAtA, i, uint64(m.Block)) - i-- - dAtA[i] = 0x18 - } - if len(m.Index) > 0 { - i -= len(m.Index) - copy(dAtA[i:], m.Index) - i = encodeVarintPlan(dAtA, i, uint64(len(m.Index))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintPlan(dAtA []byte, offset int, v uint64) int { - offset -= sovPlan(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Plan) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Index) - if l > 0 { - n += 1 + l + sovPlan(uint64(l)) - } - if m.Block != 0 { - n += 1 + sovPlan(uint64(m.Block)) - } - l = m.Price.Size() - n += 1 + l + sovPlan(uint64(l)) - if m.ComputeUnits != 0 { - n += 1 + sovPlan(uint64(m.ComputeUnits)) - } - if m.ComputeUnitsPerEpoch != 0 { - n += 1 + sovPlan(uint64(m.ComputeUnitsPerEpoch)) - } - if m.MaxProvidersToPair != 0 { - n += 1 + sovPlan(uint64(m.MaxProvidersToPair)) - } - if m.AllowOveruse { - n += 2 - } - if m.OveruseRate != 0 { - n += 1 + sovPlan(uint64(m.OveruseRate)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovPlan(uint64(l)) - } - l = len(m.Type) - if l > 0 { - n += 1 + l + sovPlan(uint64(l)) - } - if m.AnnualDiscountPercentage != 0 { - n += 1 + sovPlan(uint64(m.AnnualDiscountPercentage)) - } - return n -} - -func sovPlan(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozPlan(x uint64) (n int) { - return sovPlan(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Plan) 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 ErrIntOverflowPlan - } - 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: Plan: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Plan: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthPlan - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPlan - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Index = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) - } - m.Block = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Block |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPlan - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPlan - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Price.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ComputeUnits", wireType) - } - m.ComputeUnits = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ComputeUnits |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ComputeUnitsPerEpoch", wireType) - } - m.ComputeUnitsPerEpoch = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ComputeUnitsPerEpoch |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxProvidersToPair", wireType) - } - m.MaxProvidersToPair = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxProvidersToPair |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AllowOveruse", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AllowOveruse = bool(v != 0) - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field OveruseRate", wireType) - } - m.OveruseRate = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.OveruseRate |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthPlan - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPlan - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthPlan - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPlan - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AnnualDiscountPercentage", wireType) - } - m.AnnualDiscountPercentage = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AnnualDiscountPercentage |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipPlan(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPlan - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipPlan(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPlan - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPlan - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPlan - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthPlan - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupPlan - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthPlan - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthPlan = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowPlan = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupPlan = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/plans/migrations/v3/plan.pb.go b/x/plans/migrations/v3/plan.pb.go deleted file mode 100755 index a31305618f..0000000000 --- a/x/plans/migrations/v3/plan.pb.go +++ /dev/null @@ -1,736 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: plans/plan.proto - -package v3 - -import ( - fmt "fmt" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - v3 "github.com/lavanet/lava/v4/x/projects/migrations/v3" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Plan struct { - Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` - Block uint64 `protobuf:"varint,3,opt,name=block,proto3" json:"block,omitempty"` - Price types.Coin `protobuf:"bytes,4,opt,name=price,proto3" json:"price"` - AllowOveruse bool `protobuf:"varint,8,opt,name=allow_overuse,json=allowOveruse,proto3" json:"allow_overuse,omitempty"` - OveruseRate uint64 `protobuf:"varint,9,opt,name=overuse_rate,json=overuseRate,proto3" json:"overuse_rate,omitempty"` - Description string `protobuf:"bytes,11,opt,name=description,proto3" json:"description,omitempty"` - Type string `protobuf:"bytes,12,opt,name=type,proto3" json:"type,omitempty"` - AnnualDiscountPercentage uint64 `protobuf:"varint,13,opt,name=annual_discount_percentage,json=annualDiscountPercentage,proto3" json:"annual_discount_percentage,omitempty"` - PlanPolicy v3.Policy `protobuf:"bytes,14,opt,name=plan_policy,json=planPolicy,proto3" json:"plan_policy"` -} - -func (m *Plan) Reset() { *m = Plan{} } -func (m *Plan) String() string { return proto.CompactTextString(m) } -func (*Plan) ProtoMessage() {} -func (*Plan) Descriptor() ([]byte, []int) { - return fileDescriptor_e5909a10cd0e3497, []int{0} -} -func (m *Plan) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Plan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Plan.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 *Plan) XXX_Merge(src proto.Message) { - xxx_messageInfo_Plan.Merge(m, src) -} -func (m *Plan) XXX_Size() int { - return m.Size() -} -func (m *Plan) XXX_DiscardUnknown() { - xxx_messageInfo_Plan.DiscardUnknown(m) -} - -var xxx_messageInfo_Plan proto.InternalMessageInfo - -func (m *Plan) GetIndex() string { - if m != nil { - return m.Index - } - return "" -} - -func (m *Plan) GetBlock() uint64 { - if m != nil { - return m.Block - } - return 0 -} - -func (m *Plan) GetPrice() types.Coin { - if m != nil { - return m.Price - } - return types.Coin{} -} - -func (m *Plan) GetAllowOveruse() bool { - if m != nil { - return m.AllowOveruse - } - return false -} - -func (m *Plan) GetOveruseRate() uint64 { - if m != nil { - return m.OveruseRate - } - return 0 -} - -func (m *Plan) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *Plan) GetType() string { - if m != nil { - return m.Type - } - return "" -} - -func (m *Plan) GetAnnualDiscountPercentage() uint64 { - if m != nil { - return m.AnnualDiscountPercentage - } - return 0 -} - -func (m *Plan) GetPlanPolicy() v3.Policy { - if m != nil { - return m.PlanPolicy - } - return v3.Policy{} -} - -func init() { - proto.RegisterType((*Plan)(nil), "lavanet.lava.plans.PlanV3") -} - -func init() { proto.RegisterFile("plans/plan.proto", fileDescriptor_e5909a10cd0e3497) } - -var fileDescriptor_e5909a10cd0e3497 = []byte{ - // 418 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x52, 0xcd, 0x8e, 0xd3, 0x30, - 0x10, 0xae, 0xa9, 0xdb, 0xcd, 0x3a, 0x5d, 0x14, 0x59, 0x2b, 0x64, 0x2a, 0x11, 0x02, 0x08, 0xa9, - 0x27, 0x5b, 0x0b, 0xe2, 0xc6, 0x69, 0x77, 0x4f, 0xb9, 0x50, 0xe5, 0xc8, 0x25, 0x72, 0x5c, 0xab, - 0x18, 0xb2, 0x76, 0x14, 0xbb, 0x65, 0xf7, 0x11, 0xb8, 0xf1, 0x18, 0x3c, 0xca, 0x1e, 0xf7, 0xc8, - 0x09, 0xa1, 0xf6, 0x45, 0x90, 0x7f, 0x84, 0xe0, 0x92, 0x99, 0xf9, 0xbe, 0x2f, 0xfe, 0x3c, 0x33, - 0x46, 0xc5, 0xd0, 0x73, 0x6d, 0x99, 0xff, 0xd2, 0x61, 0x34, 0xce, 0x60, 0xdc, 0xf3, 0x3d, 0xd7, - 0xd2, 0x51, 0x1f, 0x69, 0xa0, 0x97, 0xe7, 0x5b, 0xb3, 0x35, 0x81, 0x66, 0x3e, 0x8b, 0xca, 0x65, - 0x29, 0x8c, 0xbd, 0x31, 0x96, 0x75, 0xdc, 0x4a, 0xb6, 0xbf, 0xe8, 0xa4, 0xe3, 0x17, 0x4c, 0x18, - 0x95, 0x4e, 0x5a, 0x3e, 0x19, 0x46, 0xf3, 0x59, 0x0a, 0x67, 0x59, 0x4a, 0x22, 0xfe, 0xf2, 0xdb, - 0x14, 0xc1, 0x75, 0xcf, 0x35, 0x3e, 0x47, 0x33, 0xa5, 0x37, 0xf2, 0x96, 0x80, 0x0a, 0xac, 0x4e, - 0x9b, 0x58, 0x78, 0xb4, 0xeb, 0x8d, 0xf8, 0x42, 0xa6, 0x15, 0x58, 0xc1, 0x26, 0x16, 0xf8, 0x1d, - 0x9a, 0x0d, 0xa3, 0x12, 0x92, 0xc0, 0x0a, 0xac, 0xf2, 0x37, 0x4f, 0x69, 0x34, 0xa7, 0xde, 0x9c, - 0x26, 0x73, 0x7a, 0x65, 0x94, 0xbe, 0x84, 0xf7, 0xbf, 0x9e, 0x4f, 0x9a, 0xa8, 0xc6, 0xaf, 0xd0, - 0x19, 0xef, 0x7b, 0xf3, 0xb5, 0x35, 0x7b, 0x39, 0xee, 0xac, 0x24, 0x59, 0x05, 0x56, 0x59, 0xb3, - 0x08, 0xe0, 0x87, 0x88, 0xe1, 0x17, 0x68, 0x91, 0xe8, 0x76, 0xe4, 0x4e, 0x92, 0xd3, 0x60, 0x9c, - 0x27, 0xac, 0xe1, 0x4e, 0xe2, 0x0a, 0xe5, 0x1b, 0x69, 0xc5, 0xa8, 0x06, 0xa7, 0x8c, 0x26, 0x79, - 0xb8, 0xf0, 0xbf, 0x10, 0xc6, 0x08, 0xba, 0xbb, 0x41, 0x92, 0x45, 0xa0, 0x42, 0x8e, 0xdf, 0xa3, - 0x25, 0xd7, 0x7a, 0xc7, 0xfb, 0x76, 0xa3, 0xac, 0x30, 0x3b, 0xed, 0xda, 0x41, 0x8e, 0x42, 0x6a, - 0xc7, 0xb7, 0x92, 0x9c, 0x05, 0x1b, 0x12, 0x15, 0xd7, 0x49, 0xb0, 0xfe, 0xcb, 0xe3, 0x6b, 0x94, - 0xfb, 0xf1, 0xb7, 0x83, 0xe9, 0x95, 0xb8, 0x23, 0x8f, 0x43, 0xe3, 0xcf, 0xe8, 0xff, 0xfb, 0x49, - 0x23, 0xa6, 0xeb, 0x20, 0x4a, 0xcd, 0x23, 0xff, 0x5f, 0x44, 0x6a, 0x98, 0xa1, 0x22, 0xaf, 0x61, - 0xf6, 0xa8, 0x98, 0xd6, 0x30, 0x9b, 0x15, 0xf3, 0x1a, 0x66, 0xf3, 0xe2, 0xa4, 0x86, 0xd9, 0x49, - 0x91, 0x5d, 0x5e, 0xfd, 0x38, 0x94, 0xe0, 0xfe, 0x50, 0x82, 0x87, 0x43, 0x09, 0x7e, 0x1f, 0x4a, - 0xf0, 0xfd, 0x58, 0x4e, 0x1e, 0x8e, 0xe5, 0xe4, 0xe7, 0xb1, 0x9c, 0x7c, 0x7c, 0xbd, 0x55, 0xee, - 0xd3, 0xae, 0xa3, 0xc2, 0xdc, 0xb0, 0x64, 0x1b, 0x22, 0xbb, 0x65, 0xf1, 0xdd, 0xf8, 0x2e, 0x6d, - 0x37, 0x0f, 0x7b, 0x7d, 0xfb, 0x27, 0x00, 0x00, 0xff, 0xff, 0xaa, 0xd3, 0x8a, 0x36, 0x4d, 0x02, - 0x00, 0x00, -} - -func (this *Plan) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Plan) - if !ok { - that2, ok := that.(Plan) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Index != that1.Index { - return false - } - if this.Block != that1.Block { - return false - } - if !this.Price.Equal(&that1.Price) { - return false - } - if this.AllowOveruse != that1.AllowOveruse { - return false - } - if this.OveruseRate != that1.OveruseRate { - return false - } - if this.Description != that1.Description { - return false - } - if this.Type != that1.Type { - return false - } - if this.AnnualDiscountPercentage != that1.AnnualDiscountPercentage { - return false - } - if !this.PlanPolicy.Equal(&that1.PlanPolicy) { - return false - } - return true -} -func (m *Plan) 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 *Plan) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Plan) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.PlanPolicy.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPlan(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x72 - if m.AnnualDiscountPercentage != 0 { - i = encodeVarintPlan(dAtA, i, uint64(m.AnnualDiscountPercentage)) - i-- - dAtA[i] = 0x68 - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintPlan(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0x62 - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintPlan(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x5a - } - if m.OveruseRate != 0 { - i = encodeVarintPlan(dAtA, i, uint64(m.OveruseRate)) - i-- - dAtA[i] = 0x48 - } - if m.AllowOveruse { - i-- - if m.AllowOveruse { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 - } - { - size, err := m.Price.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPlan(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if m.Block != 0 { - i = encodeVarintPlan(dAtA, i, uint64(m.Block)) - i-- - dAtA[i] = 0x18 - } - if len(m.Index) > 0 { - i -= len(m.Index) - copy(dAtA[i:], m.Index) - i = encodeVarintPlan(dAtA, i, uint64(len(m.Index))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintPlan(dAtA []byte, offset int, v uint64) int { - offset -= sovPlan(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Plan) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Index) - if l > 0 { - n += 1 + l + sovPlan(uint64(l)) - } - if m.Block != 0 { - n += 1 + sovPlan(uint64(m.Block)) - } - l = m.Price.Size() - n += 1 + l + sovPlan(uint64(l)) - if m.AllowOveruse { - n += 2 - } - if m.OveruseRate != 0 { - n += 1 + sovPlan(uint64(m.OveruseRate)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovPlan(uint64(l)) - } - l = len(m.Type) - if l > 0 { - n += 1 + l + sovPlan(uint64(l)) - } - if m.AnnualDiscountPercentage != 0 { - n += 1 + sovPlan(uint64(m.AnnualDiscountPercentage)) - } - l = m.PlanPolicy.Size() - n += 1 + l + sovPlan(uint64(l)) - return n -} - -func sovPlan(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozPlan(x uint64) (n int) { - return sovPlan(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Plan) 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 ErrIntOverflowPlan - } - 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: Plan: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Plan: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthPlan - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPlan - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Index = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) - } - m.Block = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Block |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPlan - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPlan - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Price.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AllowOveruse", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AllowOveruse = bool(v != 0) - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field OveruseRate", wireType) - } - m.OveruseRate = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.OveruseRate |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthPlan - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPlan - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthPlan - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPlan - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AnnualDiscountPercentage", wireType) - } - m.AnnualDiscountPercentage = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AnnualDiscountPercentage |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PlanPolicy", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPlan - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPlan - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PlanPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipPlan(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPlan - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipPlan(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPlan - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPlan - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPlan - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthPlan - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupPlan - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthPlan - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthPlan = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowPlan = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupPlan = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/plans/migrations/v9/plan.pb.go b/x/plans/migrations/v9/plan.pb.go deleted file mode 100644 index e4f2b01f9b..0000000000 --- a/x/plans/migrations/v9/plan.pb.go +++ /dev/null @@ -1,833 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: lavanet/lava/plans/plan.proto - -package types - -import ( - fmt "fmt" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - _ "github.com/lavanet/lava/v4/x/spec/types" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// The geolocation values are encoded as bits in a bitmask, with two special values: -// GLS is set to 0 so it will be restrictive with the AND provider. -// GL is set to -1 so it will be permissive with the AND provider. -type Geolocation int32 - -const ( - Geolocation_GLS Geolocation = 0 - Geolocation_USC Geolocation = 1 - Geolocation_EU Geolocation = 2 - Geolocation_USE Geolocation = 4 - Geolocation_USW Geolocation = 8 - Geolocation_AF Geolocation = 16 - Geolocation_AS Geolocation = 32 - Geolocation_AU Geolocation = 64 - Geolocation_GL Geolocation = 65535 -) - -var Geolocation_name = map[int32]string{ - 0: "GLS", - 1: "USC", - 2: "EU", - 4: "USE", - 8: "USW", - 16: "AF", - 32: "AS", - 64: "AU", - 65535: "GL", -} - -var Geolocation_value = map[string]int32{ - "GLS": 0, - "USC": 1, - "EU": 2, - "USE": 4, - "USW": 8, - "AF": 16, - "AS": 32, - "AU": 64, - "GL": 65535, -} - -func (x Geolocation) String() string { - return proto.EnumName(Geolocation_name, int32(x)) -} - -func (Geolocation) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_64c3707a3b09a2e5, []int{0} -} - -type Plan struct { - Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index"` - Block uint64 `protobuf:"varint,3,opt,name=block,proto3" json:"block"` - Price types.Coin `protobuf:"bytes,4,opt,name=price,proto3" json:"price"` - AllowOveruse bool `protobuf:"varint,8,opt,name=allow_overuse,json=allowOveruse,proto3" json:"allow_overuse"` - OveruseRate uint64 `protobuf:"varint,9,opt,name=overuse_rate,json=overuseRate,proto3" json:"overuse_rate"` - Description string `protobuf:"bytes,11,opt,name=description,proto3" json:"description"` - Type string `protobuf:"bytes,12,opt,name=type,proto3" json:"type"` - AnnualDiscountPercentage uint64 `protobuf:"varint,13,opt,name=annual_discount_percentage,json=annualDiscountPercentage,proto3" json:"annual_discount_percentage"` - PlanPolicy Policy `protobuf:"bytes,14,opt,name=plan_policy,json=planPolicy,proto3" json:"plan_policy"` - Projects uint64 `protobuf:"varint,15,opt,name=projects,proto3" json:"projects"` -} - -func (m *Plan) Reset() { *m = Plan{} } -func (m *Plan) String() string { return proto.CompactTextString(m) } -func (*Plan) ProtoMessage() {} -func (*Plan) Descriptor() ([]byte, []int) { - return fileDescriptor_64c3707a3b09a2e5, []int{0} -} -func (m *Plan) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Plan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Plan.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 *Plan) XXX_Merge(src proto.Message) { - xxx_messageInfo_Plan.Merge(m, src) -} -func (m *Plan) XXX_Size() int { - return m.Size() -} -func (m *Plan) XXX_DiscardUnknown() { - xxx_messageInfo_Plan.DiscardUnknown(m) -} - -var xxx_messageInfo_Plan proto.InternalMessageInfo - -func (m *Plan) GetIndex() string { - if m != nil { - return m.Index - } - return "" -} - -func (m *Plan) GetBlock() uint64 { - if m != nil { - return m.Block - } - return 0 -} - -func (m *Plan) GetPrice() types.Coin { - if m != nil { - return m.Price - } - return types.Coin{} -} - -func (m *Plan) GetAllowOveruse() bool { - if m != nil { - return m.AllowOveruse - } - return false -} - -func (m *Plan) GetOveruseRate() uint64 { - if m != nil { - return m.OveruseRate - } - return 0 -} - -func (m *Plan) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *Plan) GetType() string { - if m != nil { - return m.Type - } - return "" -} - -func (m *Plan) GetAnnualDiscountPercentage() uint64 { - if m != nil { - return m.AnnualDiscountPercentage - } - return 0 -} - -func (m *Plan) GetPlanPolicy() Policy { - if m != nil { - return m.PlanPolicy - } - return Policy{} -} - -func (m *Plan) GetProjects() uint64 { - if m != nil { - return m.Projects - } - return 0 -} - -func init() { - proto.RegisterEnum("lavanet.lava.plans.GeolocationV9", Geolocation_name, Geolocation_value) - proto.RegisterType((*Plan)(nil), "lavanet.lava.plans.PlanV9") -} - -func init() { proto.RegisterFile("lavanet/lava/plans/plan.proto", fileDescriptor_64c3707a3b09a2e5) } - -var fileDescriptor_64c3707a3b09a2e5 = []byte{ - // 568 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0x41, 0x8b, 0xd3, 0x40, - 0x14, 0x6e, 0xda, 0x6c, 0x3b, 0x9d, 0xb4, 0xee, 0x38, 0x7a, 0x88, 0x45, 0x93, 0x22, 0x28, 0xc5, - 0x43, 0x42, 0x5d, 0xf0, 0x28, 0xda, 0xba, 0x16, 0xca, 0x82, 0x25, 0xa5, 0x08, 0x2a, 0x84, 0xe9, - 0x74, 0xa8, 0xd1, 0x6c, 0x26, 0x24, 0x69, 0xdd, 0xfd, 0x17, 0xfe, 0x0c, 0x7f, 0x85, 0xe7, 0x3d, - 0xee, 0xd1, 0x53, 0x90, 0xf6, 0x96, 0x3f, 0xb1, 0x32, 0x33, 0xd9, 0xd2, 0xa2, 0x78, 0x99, 0xef, - 0xbd, 0xef, 0xfb, 0x26, 0x79, 0xef, 0xcd, 0x83, 0x8f, 0x42, 0xb2, 0x26, 0x11, 0xcb, 0x5c, 0x81, - 0x6e, 0x1c, 0x92, 0x28, 0x95, 0xa7, 0x13, 0x27, 0x3c, 0xe3, 0x18, 0x97, 0xb2, 0x23, 0xd0, 0x91, - 0x72, 0xe7, 0xfe, 0x92, 0x2f, 0xb9, 0x94, 0x5d, 0x11, 0x29, 0x67, 0xc7, 0xa2, 0x3c, 0x3d, 0xe7, - 0xa9, 0x3b, 0x27, 0x29, 0x73, 0xd7, 0xfd, 0x39, 0xcb, 0x48, 0xdf, 0xa5, 0x3c, 0x28, 0xbf, 0xd4, - 0x79, 0x7a, 0xf0, 0xa3, 0x34, 0x66, 0xd4, 0x25, 0x71, 0xe0, 0x53, 0x1e, 0x86, 0x8c, 0x66, 0x01, - 0xbf, 0xf5, 0xd9, 0xff, 0x2a, 0x88, 0x87, 0x01, 0xbd, 0x54, 0x86, 0xc7, 0x3f, 0x75, 0xa8, 0x4f, - 0x42, 0x12, 0x61, 0x1b, 0x1e, 0x05, 0xd1, 0x82, 0x5d, 0x98, 0x5a, 0x57, 0xeb, 0x35, 0x07, 0xcd, - 0x22, 0xb7, 0x15, 0xe1, 0x29, 0x10, 0x86, 0x79, 0xc8, 0xe9, 0x57, 0xb3, 0xd6, 0xd5, 0x7a, 0xba, - 0x32, 0x48, 0xc2, 0x53, 0x80, 0x5f, 0xc2, 0xa3, 0x38, 0x09, 0x28, 0x33, 0xf5, 0xae, 0xd6, 0x33, - 0x9e, 0x3f, 0x70, 0x54, 0x0f, 0x8e, 0xe8, 0xc1, 0x29, 0x7b, 0x70, 0x86, 0x3c, 0x88, 0x06, 0xed, - 0xab, 0xdc, 0xae, 0x88, 0xfb, 0xd2, 0xef, 0x29, 0xc0, 0x2f, 0x60, 0x9b, 0x84, 0x21, 0xff, 0xe6, - 0xf3, 0x35, 0x4b, 0x56, 0x29, 0x33, 0x41, 0x57, 0xeb, 0x81, 0xc1, 0xdd, 0x22, 0xb7, 0x0f, 0x05, - 0xaf, 0x25, 0xd3, 0x77, 0x2a, 0xc3, 0x27, 0xb0, 0x55, 0x0a, 0x7e, 0x42, 0x32, 0x66, 0x36, 0x65, - 0x7d, 0xa8, 0xc8, 0xed, 0x03, 0xde, 0x33, 0x6e, 0xaf, 0x93, 0x8c, 0xe1, 0x3e, 0x34, 0x16, 0x2c, - 0xa5, 0x49, 0x10, 0x8b, 0x69, 0x99, 0x86, 0x6c, 0xfa, 0xb8, 0xc8, 0xed, 0x7d, 0xda, 0xdb, 0x4f, - 0xf0, 0x43, 0xa8, 0x67, 0x97, 0x31, 0x33, 0x5b, 0xd2, 0x0b, 0x8a, 0xdc, 0x96, 0xb9, 0x27, 0x4f, - 0xfc, 0x09, 0x76, 0x48, 0x14, 0xad, 0x48, 0xe8, 0x2f, 0x82, 0x94, 0xf2, 0x55, 0x94, 0xf9, 0x31, - 0x4b, 0x28, 0x8b, 0x32, 0xb2, 0x64, 0x66, 0x5b, 0xd6, 0x64, 0x15, 0xb9, 0xfd, 0x1f, 0x97, 0x67, - 0x2a, 0xed, 0x4d, 0x29, 0x4d, 0x76, 0x0a, 0x9e, 0x40, 0x43, 0x3c, 0x9e, 0xaf, 0xde, 0xce, 0xbc, - 0x23, 0x27, 0xdc, 0x71, 0xfe, 0xde, 0x27, 0x67, 0x22, 0x1d, 0x83, 0x7b, 0xe5, 0x88, 0xf7, 0xaf, - 0x79, 0x50, 0x24, 0xca, 0x80, 0x7b, 0x10, 0xc4, 0x09, 0xff, 0xc2, 0x68, 0x96, 0x9a, 0xc7, 0xb2, - 0xba, 0x56, 0x91, 0xdb, 0x3b, 0xce, 0xdb, 0x45, 0x63, 0x1d, 0x40, 0x64, 0x8c, 0x75, 0x50, 0x45, - 0xb5, 0xb1, 0x0e, 0x8e, 0x50, 0x7d, 0xac, 0x83, 0x3a, 0x6a, 0x8c, 0x75, 0xd0, 0x40, 0xe0, 0xd9, - 0x47, 0x68, 0x8c, 0x18, 0x0f, 0x39, 0x25, 0x72, 0x48, 0x0d, 0x58, 0x1b, 0x9d, 0x4d, 0x51, 0x45, - 0x04, 0xb3, 0xe9, 0x10, 0x69, 0xb8, 0x0e, 0xab, 0xa7, 0x33, 0x54, 0x55, 0xc4, 0x29, 0xd2, 0x55, - 0xf0, 0x1e, 0x01, 0xa1, 0xbc, 0x7e, 0x8b, 0x90, 0xc4, 0x29, 0xea, 0x4a, 0x9c, 0xa1, 0x57, 0x18, - 0xc0, 0xea, 0xe8, 0x0c, 0xdd, 0xdc, 0xd4, 0x06, 0xc3, 0x1f, 0x1b, 0x4b, 0xbb, 0xda, 0x58, 0xda, - 0xf5, 0xc6, 0xd2, 0x7e, 0x6f, 0x2c, 0xed, 0xfb, 0xd6, 0xaa, 0x5c, 0x6f, 0xad, 0xca, 0xaf, 0xad, - 0x55, 0xf9, 0xf0, 0x64, 0x19, 0x64, 0x9f, 0x57, 0x73, 0x87, 0xf2, 0x73, 0xf7, 0x60, 0xcf, 0x2f, - 0xca, 0x4d, 0x17, 0x0f, 0x93, 0xce, 0xeb, 0x72, 0xd3, 0x4f, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, - 0xaa, 0xdb, 0x6c, 0x10, 0x9d, 0x03, 0x00, 0x00, -} - -func (this *Plan) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Plan) - if !ok { - that2, ok := that.(Plan) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Index != that1.Index { - return false - } - if this.Block != that1.Block { - return false - } - if !this.Price.Equal(&that1.Price) { - return false - } - if this.AllowOveruse != that1.AllowOveruse { - return false - } - if this.OveruseRate != that1.OveruseRate { - return false - } - if this.Description != that1.Description { - return false - } - if this.Type != that1.Type { - return false - } - if this.AnnualDiscountPercentage != that1.AnnualDiscountPercentage { - return false - } - if !this.PlanPolicy.Equal(&that1.PlanPolicy) { - return false - } - if this.Projects != that1.Projects { - return false - } - return true -} -func (m *Plan) 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 *Plan) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Plan) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Projects != 0 { - i = encodeVarintPlan(dAtA, i, uint64(m.Projects)) - i-- - dAtA[i] = 0x78 - } - { - size, err := m.PlanPolicy.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPlan(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x72 - if m.AnnualDiscountPercentage != 0 { - i = encodeVarintPlan(dAtA, i, uint64(m.AnnualDiscountPercentage)) - i-- - dAtA[i] = 0x68 - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintPlan(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0x62 - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintPlan(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x5a - } - if m.OveruseRate != 0 { - i = encodeVarintPlan(dAtA, i, uint64(m.OveruseRate)) - i-- - dAtA[i] = 0x48 - } - if m.AllowOveruse { - i-- - if m.AllowOveruse { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 - } - { - size, err := m.Price.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPlan(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if m.Block != 0 { - i = encodeVarintPlan(dAtA, i, uint64(m.Block)) - i-- - dAtA[i] = 0x18 - } - if len(m.Index) > 0 { - i -= len(m.Index) - copy(dAtA[i:], m.Index) - i = encodeVarintPlan(dAtA, i, uint64(len(m.Index))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintPlan(dAtA []byte, offset int, v uint64) int { - offset -= sovPlan(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Plan) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Index) - if l > 0 { - n += 1 + l + sovPlan(uint64(l)) - } - if m.Block != 0 { - n += 1 + sovPlan(uint64(m.Block)) - } - l = m.Price.Size() - n += 1 + l + sovPlan(uint64(l)) - if m.AllowOveruse { - n += 2 - } - if m.OveruseRate != 0 { - n += 1 + sovPlan(uint64(m.OveruseRate)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovPlan(uint64(l)) - } - l = len(m.Type) - if l > 0 { - n += 1 + l + sovPlan(uint64(l)) - } - if m.AnnualDiscountPercentage != 0 { - n += 1 + sovPlan(uint64(m.AnnualDiscountPercentage)) - } - l = m.PlanPolicy.Size() - n += 1 + l + sovPlan(uint64(l)) - if m.Projects != 0 { - n += 1 + sovPlan(uint64(m.Projects)) - } - return n -} - -func sovPlan(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozPlan(x uint64) (n int) { - return sovPlan(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Plan) 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 ErrIntOverflowPlan - } - 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: Plan: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Plan: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthPlan - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPlan - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Index = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) - } - m.Block = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Block |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPlan - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPlan - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Price.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AllowOveruse", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AllowOveruse = bool(v != 0) - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field OveruseRate", wireType) - } - m.OveruseRate = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.OveruseRate |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthPlan - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPlan - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthPlan - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPlan - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AnnualDiscountPercentage", wireType) - } - m.AnnualDiscountPercentage = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AnnualDiscountPercentage |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PlanPolicy", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPlan - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPlan - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PlanPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Projects", wireType) - } - m.Projects = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPlan - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Projects |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipPlan(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPlan - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipPlan(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPlan - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPlan - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPlan - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthPlan - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupPlan - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthPlan - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthPlan = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowPlan = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupPlan = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/plans/migrations/v9/policy.pb.go b/x/plans/migrations/v9/policy.pb.go deleted file mode 100644 index 5a43d1f1f6..0000000000 --- a/x/plans/migrations/v9/policy.pb.go +++ /dev/null @@ -1,1307 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: lavanet/lava/plans/policy.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - types "github.com/lavanet/lava/v4/x/spec/types" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// the enum below determines the pairing algorithm's behaviour with the selected providers feature -type SELECTED_PROVIDERS_MODE int32 - -const ( - SELECTED_PROVIDERS_MODE_ALLOWED SELECTED_PROVIDERS_MODE = 0 - SELECTED_PROVIDERS_MODE_MIXED SELECTED_PROVIDERS_MODE = 1 - SELECTED_PROVIDERS_MODE_EXCLUSIVE SELECTED_PROVIDERS_MODE = 2 - SELECTED_PROVIDERS_MODE_DISABLED SELECTED_PROVIDERS_MODE = 3 -) - -var SELECTED_PROVIDERS_MODE_name = map[int32]string{ - 0: "ALLOWED", - 1: "MIXED", - 2: "EXCLUSIVE", - 3: "DISABLED", -} - -var SELECTED_PROVIDERS_MODE_value = map[string]int32{ - "ALLOWED": 0, - "MIXED": 1, - "EXCLUSIVE": 2, - "DISABLED": 3, -} - -func (x SELECTED_PROVIDERS_MODE) String() string { - return proto.EnumName(SELECTED_PROVIDERS_MODE_name, int32(x)) -} - -func (SELECTED_PROVIDERS_MODE) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_c2388e0faa8deb9b, []int{0} -} - -// protobuf expected in YAML format: used "moretags" to simplify parsing -type Policy struct { - ChainPolicies []ChainPolicy `protobuf:"bytes,1,rep,name=chain_policies,json=chainPolicies,proto3" json:"chain_policies"` - GeolocationProfile int32 `protobuf:"varint,2,opt,name=geolocation_profile,json=geolocationProfile,proto3" json:"geolocation_profile"` - TotalCuLimit uint64 `protobuf:"varint,3,opt,name=total_cu_limit,json=totalCuLimit,proto3" json:"total_cu_limit"` - EpochCuLimit uint64 `protobuf:"varint,4,opt,name=epoch_cu_limit,json=epochCuLimit,proto3" json:"epoch_cu_limit"` - MaxProvidersToPair uint64 `protobuf:"varint,5,opt,name=max_providers_to_pair,json=maxProvidersToPair,proto3" json:"max_providers_to_pair"` - SelectedProvidersMode SELECTED_PROVIDERS_MODE `protobuf:"varint,6,opt,name=selected_providers_mode,json=selectedProvidersMode,proto3,enum=lavanet.lava.plans.SELECTED_PROVIDERS_MODE" json:"selected_providers_mode"` - SelectedProviders []string `protobuf:"bytes,7,rep,name=selected_providers,json=selectedProviders,proto3" json:"selected_providers"` -} - -func (m *Policy) Reset() { *m = Policy{} } -func (m *Policy) String() string { return proto.CompactTextString(m) } -func (*Policy) ProtoMessage() {} -func (*Policy) Descriptor() ([]byte, []int) { - return fileDescriptor_c2388e0faa8deb9b, []int{0} -} -func (m *Policy) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Policy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Policy.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 *Policy) XXX_Merge(src proto.Message) { - xxx_messageInfo_Policy.Merge(m, src) -} -func (m *Policy) XXX_Size() int { - return m.Size() -} -func (m *Policy) XXX_DiscardUnknown() { - xxx_messageInfo_Policy.DiscardUnknown(m) -} - -var xxx_messageInfo_Policy proto.InternalMessageInfo - -func (m *Policy) GetChainPolicies() []ChainPolicy { - if m != nil { - return m.ChainPolicies - } - return nil -} - -func (m *Policy) GetGeolocationProfile() int32 { - if m != nil { - return m.GeolocationProfile - } - return 0 -} - -func (m *Policy) GetTotalCuLimit() uint64 { - if m != nil { - return m.TotalCuLimit - } - return 0 -} - -func (m *Policy) GetEpochCuLimit() uint64 { - if m != nil { - return m.EpochCuLimit - } - return 0 -} - -func (m *Policy) GetMaxProvidersToPair() uint64 { - if m != nil { - return m.MaxProvidersToPair - } - return 0 -} - -func (m *Policy) GetSelectedProvidersMode() SELECTED_PROVIDERS_MODE { - if m != nil { - return m.SelectedProvidersMode - } - return SELECTED_PROVIDERS_MODE_ALLOWED -} - -func (m *Policy) GetSelectedProviders() []string { - if m != nil { - return m.SelectedProviders - } - return nil -} - -type ChainPolicy struct { - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id"` - Apis []string `protobuf:"bytes,2,rep,name=apis,proto3" json:"apis"` - Requirements []ChainRequirement `protobuf:"bytes,3,rep,name=requirements,proto3" json:"requirements"` -} - -func (m *ChainPolicy) Reset() { *m = ChainPolicy{} } -func (m *ChainPolicy) String() string { return proto.CompactTextString(m) } -func (*ChainPolicy) ProtoMessage() {} -func (*ChainPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_c2388e0faa8deb9b, []int{1} -} -func (m *ChainPolicy) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ChainPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChainPolicy.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 *ChainPolicy) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChainPolicy.Merge(m, src) -} -func (m *ChainPolicy) XXX_Size() int { - return m.Size() -} -func (m *ChainPolicy) XXX_DiscardUnknown() { - xxx_messageInfo_ChainPolicy.DiscardUnknown(m) -} - -var xxx_messageInfo_ChainPolicy proto.InternalMessageInfo - -func (m *ChainPolicy) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - -func (m *ChainPolicy) GetApis() []string { - if m != nil { - return m.Apis - } - return nil -} - -func (m *ChainPolicy) GetRequirements() []ChainRequirement { - if m != nil { - return m.Requirements - } - return nil -} - -type ChainRequirement struct { - Collection types.CollectionData `protobuf:"bytes,1,opt,name=collection,proto3" json:"collection"` - Extensions []string `protobuf:"bytes,2,rep,name=extensions,proto3" json:"extensions"` - Mixed bool `protobuf:"varint,3,opt,name=mixed,proto3" json:"mixed"` -} - -func (m *ChainRequirement) Reset() { *m = ChainRequirement{} } -func (m *ChainRequirement) String() string { return proto.CompactTextString(m) } -func (*ChainRequirement) ProtoMessage() {} -func (*ChainRequirement) Descriptor() ([]byte, []int) { - return fileDescriptor_c2388e0faa8deb9b, []int{2} -} -func (m *ChainRequirement) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ChainRequirement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChainRequirement.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 *ChainRequirement) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChainRequirement.Merge(m, src) -} -func (m *ChainRequirement) XXX_Size() int { - return m.Size() -} -func (m *ChainRequirement) XXX_DiscardUnknown() { - xxx_messageInfo_ChainRequirement.DiscardUnknown(m) -} - -var xxx_messageInfo_ChainRequirement proto.InternalMessageInfo - -func (m *ChainRequirement) GetCollection() types.CollectionData { - if m != nil { - return m.Collection - } - return types.CollectionData{} -} - -func (m *ChainRequirement) GetExtensions() []string { - if m != nil { - return m.Extensions - } - return nil -} - -func (m *ChainRequirement) GetMixed() bool { - if m != nil { - return m.Mixed - } - return false -} - -func init() { - proto.RegisterEnum("lavanet.lava.plans.SELECTED_PROVIDERS_MODEV9", SELECTED_PROVIDERS_MODE_name, SELECTED_PROVIDERS_MODE_value) - proto.RegisterType((*Policy)(nil), "lavanet.lava.plans.PolicyV9") - proto.RegisterType((*ChainPolicy)(nil), "lavanet.lava.plans.ChainPolicyV9") - proto.RegisterType((*ChainRequirement)(nil), "lavanet.lava.plans.ChainRequirementV9") -} - -func init() { proto.RegisterFile("lavanet/lava/plans/policy.proto", fileDescriptor_c2388e0faa8deb9b) } - -var fileDescriptor_c2388e0faa8deb9b = []byte{ - // 678 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x54, 0xcb, 0x6e, 0xda, 0x4a, - 0x18, 0x66, 0x02, 0x24, 0x30, 0x10, 0xc4, 0x99, 0x93, 0x8b, 0x4f, 0xce, 0x91, 0xcd, 0x89, 0x7a, - 0x41, 0xad, 0x64, 0x2b, 0xe9, 0xa6, 0xdb, 0x18, 0x5b, 0x2a, 0x12, 0x69, 0xd0, 0x90, 0xa4, 0x51, - 0x17, 0xb1, 0x06, 0x33, 0x25, 0x23, 0xd9, 0x8c, 0x6b, 0x9b, 0x88, 0xec, 0xfa, 0x08, 0x7d, 0x8c, - 0x3e, 0x40, 0x57, 0x5d, 0x74, 0x9d, 0x65, 0x96, 0x5d, 0x59, 0x15, 0xd9, 0xf9, 0x29, 0x2a, 0x0f, - 0x57, 0x27, 0x64, 0xc3, 0xfc, 0x97, 0xef, 0xfb, 0xff, 0x0f, 0xf8, 0x66, 0xa0, 0xe2, 0x90, 0x6b, - 0x32, 0xa0, 0xa1, 0x96, 0x9c, 0x9a, 0xe7, 0x90, 0x41, 0xa0, 0x79, 0xdc, 0x61, 0xf6, 0x8d, 0xea, - 0xf9, 0x3c, 0xe4, 0x08, 0x4d, 0x01, 0x6a, 0x72, 0xaa, 0x02, 0xb0, 0xb7, 0xd5, 0xe7, 0x7d, 0x2e, - 0xda, 0x5a, 0x12, 0x4d, 0x90, 0x7b, 0xb2, 0xcd, 0x03, 0x97, 0x07, 0x5a, 0x97, 0x04, 0x54, 0xbb, - 0x3e, 0xe8, 0xd2, 0x90, 0x1c, 0x68, 0x36, 0x67, 0x83, 0x69, 0xff, 0x45, 0x6a, 0x55, 0xe0, 0x51, - 0x5b, 0x23, 0x1e, 0xb3, 0x6c, 0xee, 0x38, 0xd4, 0x0e, 0x19, 0x9f, 0xe2, 0xf6, 0x7f, 0xe6, 0xe0, - 0x7a, 0x5b, 0x48, 0x40, 0x97, 0xb0, 0x62, 0x5f, 0x11, 0x36, 0xb0, 0x84, 0x24, 0x46, 0x03, 0x09, - 0xd4, 0xb2, 0xf5, 0xd2, 0xa1, 0xa2, 0x3e, 0x56, 0xa5, 0x36, 0x12, 0xe4, 0x84, 0xa8, 0xef, 0xdc, - 0x46, 0x4a, 0x26, 0x8e, 0x94, 0x07, 0x74, 0xbc, 0x69, 0xcf, 0x41, 0x8c, 0x06, 0xe8, 0x1d, 0xfc, - 0xbb, 0x4f, 0xb9, 0xc3, 0x6d, 0x92, 0xec, 0xb7, 0x3c, 0x9f, 0x7f, 0x62, 0x0e, 0x95, 0xd6, 0x6a, - 0xa0, 0x9e, 0xd7, 0x77, 0xe3, 0x48, 0x59, 0xd5, 0xc6, 0x68, 0xa9, 0xd8, 0x9e, 0xd4, 0xd0, 0x5b, - 0x58, 0x09, 0x79, 0x48, 0x1c, 0xcb, 0x1e, 0x5a, 0x0e, 0x73, 0x59, 0x28, 0x65, 0x6b, 0xa0, 0x9e, - 0xd3, 0x51, 0x22, 0x22, 0xdd, 0xc1, 0x65, 0x91, 0x37, 0x86, 0xad, 0x24, 0x4b, 0x98, 0xd4, 0xe3, - 0xf6, 0xd5, 0x82, 0x99, 0x5b, 0x30, 0xd3, 0x1d, 0x5c, 0x16, 0xf9, 0x8c, 0xd9, 0x82, 0xdb, 0x2e, - 0x19, 0x25, 0xb2, 0xae, 0x59, 0x8f, 0xfa, 0x81, 0x15, 0x72, 0xcb, 0x23, 0xcc, 0x97, 0xf2, 0x62, - 0xc0, 0x3f, 0x71, 0xa4, 0xac, 0x06, 0x60, 0xe4, 0x92, 0x51, 0x7b, 0x56, 0x3d, 0xe5, 0x6d, 0xc2, - 0x7c, 0xf4, 0x05, 0xc0, 0xdd, 0x80, 0x26, 0x7f, 0x05, 0xed, 0x2d, 0x51, 0x5c, 0xde, 0xa3, 0xd2, - 0x7a, 0x0d, 0xd4, 0x2b, 0x87, 0xaf, 0x57, 0xfd, 0xea, 0x1d, 0xb3, 0x65, 0x36, 0x4e, 0x4d, 0xc3, - 0x6a, 0xe3, 0x93, 0xf3, 0xa6, 0x61, 0xe2, 0x8e, 0x75, 0x7c, 0x62, 0x98, 0xfa, 0xbf, 0x71, 0xa4, - 0x3c, 0x35, 0x0f, 0x6f, 0xcf, 0x1a, 0x73, 0x11, 0xc7, 0xbc, 0x47, 0x91, 0x09, 0xd1, 0x63, 0x86, - 0xb4, 0x51, 0xcb, 0xd6, 0x8b, 0xfa, 0x4e, 0x1c, 0x29, 0x2b, 0xba, 0xf8, 0xaf, 0x47, 0xa3, 0xf6, - 0xbf, 0x03, 0x58, 0x5a, 0x32, 0x03, 0x7a, 0x09, 0x0b, 0x13, 0x1b, 0xb0, 0x9e, 0x04, 0x6a, 0xa0, - 0x5e, 0xd4, 0xcb, 0x71, 0xa4, 0xcc, 0x6b, 0x78, 0x43, 0x44, 0xcd, 0x1e, 0xfa, 0x0f, 0xe6, 0x88, - 0xc7, 0x02, 0x69, 0x4d, 0x6c, 0x2c, 0xc4, 0x91, 0x22, 0x72, 0x2c, 0x3e, 0xd1, 0x25, 0x2c, 0xfb, - 0xf4, 0xf3, 0x90, 0xf9, 0xd4, 0xa5, 0x83, 0x30, 0x90, 0xb2, 0xc2, 0x8a, 0xcf, 0x9e, 0xb4, 0x22, - 0x5e, 0x80, 0xf5, 0xad, 0xa9, 0x1f, 0x53, 0x13, 0x70, 0x2a, 0xdb, 0xff, 0x01, 0x60, 0xf5, 0x21, - 0x11, 0x9d, 0x41, 0xb8, 0xb8, 0x20, 0x42, 0x7d, 0xe9, 0xf0, 0xff, 0xf4, 0xca, 0xe4, 0x26, 0xa9, - 0x8d, 0x39, 0xc8, 0x20, 0x21, 0xd1, 0xd1, 0x74, 0xdf, 0x12, 0x19, 0x2f, 0xc5, 0x48, 0x85, 0x90, - 0x8e, 0x42, 0x3a, 0x08, 0x18, 0x1f, 0xcc, 0xbe, 0x6f, 0x25, 0xc1, 0x2f, 0xaa, 0x78, 0x29, 0x46, - 0x0a, 0xcc, 0xbb, 0x6c, 0x44, 0x7b, 0xc2, 0xd5, 0x05, 0xbd, 0x18, 0x47, 0xca, 0xa4, 0x80, 0x27, - 0xc7, 0xab, 0xf7, 0x70, 0xf7, 0x09, 0x27, 0xa0, 0x12, 0xdc, 0x38, 0x6a, 0xb5, 0x4e, 0x3e, 0x98, - 0x46, 0x35, 0x83, 0x8a, 0x30, 0x7f, 0xdc, 0xbc, 0x30, 0x8d, 0x2a, 0x40, 0x9b, 0xb0, 0x68, 0x5e, - 0x34, 0x5a, 0x67, 0x9d, 0xe6, 0xb9, 0x59, 0x5d, 0x43, 0x65, 0x58, 0x30, 0x9a, 0x9d, 0x23, 0xbd, - 0x65, 0x1a, 0xd5, 0xac, 0xde, 0xf8, 0x36, 0x96, 0xc1, 0xed, 0x58, 0x06, 0x77, 0x63, 0x19, 0xfc, - 0x1e, 0xcb, 0xe0, 0xeb, 0xbd, 0x9c, 0xb9, 0xbb, 0x97, 0x33, 0xbf, 0xee, 0xe5, 0xcc, 0xc7, 0xe7, - 0x7d, 0x16, 0x5e, 0x0d, 0xbb, 0xaa, 0xcd, 0x5d, 0x2d, 0xf5, 0xaa, 0x8c, 0xa6, 0x4f, 0x58, 0x78, - 0xe3, 0xd1, 0xa0, 0xbb, 0x2e, 0x1e, 0x94, 0x37, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x08, 0x9a, - 0x8f, 0xe7, 0xe5, 0x04, 0x00, 0x00, -} - -func (this *Policy) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Policy) - if !ok { - that2, ok := that.(Policy) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.ChainPolicies) != len(that1.ChainPolicies) { - return false - } - for i := range this.ChainPolicies { - if !this.ChainPolicies[i].Equal(&that1.ChainPolicies[i]) { - return false - } - } - if this.GeolocationProfile != that1.GeolocationProfile { - return false - } - if this.TotalCuLimit != that1.TotalCuLimit { - return false - } - if this.EpochCuLimit != that1.EpochCuLimit { - return false - } - if this.MaxProvidersToPair != that1.MaxProvidersToPair { - return false - } - if this.SelectedProvidersMode != that1.SelectedProvidersMode { - return false - } - if len(this.SelectedProviders) != len(that1.SelectedProviders) { - return false - } - for i := range this.SelectedProviders { - if this.SelectedProviders[i] != that1.SelectedProviders[i] { - return false - } - } - return true -} -func (this *ChainPolicy) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ChainPolicy) - if !ok { - that2, ok := that.(ChainPolicy) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ChainId != that1.ChainId { - return false - } - if len(this.Apis) != len(that1.Apis) { - return false - } - for i := range this.Apis { - if this.Apis[i] != that1.Apis[i] { - return false - } - } - if len(this.Requirements) != len(that1.Requirements) { - return false - } - for i := range this.Requirements { - if !this.Requirements[i].Equal(&that1.Requirements[i]) { - return false - } - } - return true -} -func (this *ChainRequirement) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ChainRequirement) - if !ok { - that2, ok := that.(ChainRequirement) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Collection.Equal(&that1.Collection) { - return false - } - if len(this.Extensions) != len(that1.Extensions) { - return false - } - for i := range this.Extensions { - if this.Extensions[i] != that1.Extensions[i] { - return false - } - } - if this.Mixed != that1.Mixed { - return false - } - return true -} -func (m *Policy) 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 *Policy) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Policy) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SelectedProviders) > 0 { - for iNdEx := len(m.SelectedProviders) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.SelectedProviders[iNdEx]) - copy(dAtA[i:], m.SelectedProviders[iNdEx]) - i = encodeVarintPolicy(dAtA, i, uint64(len(m.SelectedProviders[iNdEx]))) - i-- - dAtA[i] = 0x3a - } - } - if m.SelectedProvidersMode != 0 { - i = encodeVarintPolicy(dAtA, i, uint64(m.SelectedProvidersMode)) - i-- - dAtA[i] = 0x30 - } - if m.MaxProvidersToPair != 0 { - i = encodeVarintPolicy(dAtA, i, uint64(m.MaxProvidersToPair)) - i-- - dAtA[i] = 0x28 - } - if m.EpochCuLimit != 0 { - i = encodeVarintPolicy(dAtA, i, uint64(m.EpochCuLimit)) - i-- - dAtA[i] = 0x20 - } - if m.TotalCuLimit != 0 { - i = encodeVarintPolicy(dAtA, i, uint64(m.TotalCuLimit)) - i-- - dAtA[i] = 0x18 - } - if m.GeolocationProfile != 0 { - i = encodeVarintPolicy(dAtA, i, uint64(m.GeolocationProfile)) - i-- - dAtA[i] = 0x10 - } - if len(m.ChainPolicies) > 0 { - for iNdEx := len(m.ChainPolicies) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ChainPolicies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPolicy(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ChainPolicy) 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 *ChainPolicy) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChainPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Requirements) > 0 { - for iNdEx := len(m.Requirements) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Requirements[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPolicy(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Apis) > 0 { - for iNdEx := len(m.Apis) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Apis[iNdEx]) - copy(dAtA[i:], m.Apis[iNdEx]) - i = encodeVarintPolicy(dAtA, i, uint64(len(m.Apis[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintPolicy(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ChainRequirement) 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 *ChainRequirement) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChainRequirement) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Mixed { - i-- - if m.Mixed { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if len(m.Extensions) > 0 { - for iNdEx := len(m.Extensions) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Extensions[iNdEx]) - copy(dAtA[i:], m.Extensions[iNdEx]) - i = encodeVarintPolicy(dAtA, i, uint64(len(m.Extensions[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.Collection.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPolicy(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintPolicy(dAtA []byte, offset int, v uint64) int { - offset -= sovPolicy(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Policy) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ChainPolicies) > 0 { - for _, e := range m.ChainPolicies { - l = e.Size() - n += 1 + l + sovPolicy(uint64(l)) - } - } - if m.GeolocationProfile != 0 { - n += 1 + sovPolicy(uint64(m.GeolocationProfile)) - } - if m.TotalCuLimit != 0 { - n += 1 + sovPolicy(uint64(m.TotalCuLimit)) - } - if m.EpochCuLimit != 0 { - n += 1 + sovPolicy(uint64(m.EpochCuLimit)) - } - if m.MaxProvidersToPair != 0 { - n += 1 + sovPolicy(uint64(m.MaxProvidersToPair)) - } - if m.SelectedProvidersMode != 0 { - n += 1 + sovPolicy(uint64(m.SelectedProvidersMode)) - } - if len(m.SelectedProviders) > 0 { - for _, s := range m.SelectedProviders { - l = len(s) - n += 1 + l + sovPolicy(uint64(l)) - } - } - return n -} - -func (m *ChainPolicy) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovPolicy(uint64(l)) - } - if len(m.Apis) > 0 { - for _, s := range m.Apis { - l = len(s) - n += 1 + l + sovPolicy(uint64(l)) - } - } - if len(m.Requirements) > 0 { - for _, e := range m.Requirements { - l = e.Size() - n += 1 + l + sovPolicy(uint64(l)) - } - } - return n -} - -func (m *ChainRequirement) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Collection.Size() - n += 1 + l + sovPolicy(uint64(l)) - if len(m.Extensions) > 0 { - for _, s := range m.Extensions { - l = len(s) - n += 1 + l + sovPolicy(uint64(l)) - } - } - if m.Mixed { - n += 2 - } - return n -} - -func sovPolicy(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozPolicy(x uint64) (n int) { - return sovPolicy(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Policy) 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 ErrIntOverflowPolicy - } - 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: Policy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Policy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainPolicies", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPolicy - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPolicy - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPolicy - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainPolicies = append(m.ChainPolicies, ChainPolicy{}) - if err := m.ChainPolicies[len(m.ChainPolicies)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GeolocationProfile", wireType) - } - m.GeolocationProfile = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPolicy - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GeolocationProfile |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalCuLimit", wireType) - } - m.TotalCuLimit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPolicy - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalCuLimit |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochCuLimit", wireType) - } - m.EpochCuLimit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPolicy - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EpochCuLimit |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxProvidersToPair", wireType) - } - m.MaxProvidersToPair = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPolicy - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxProvidersToPair |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SelectedProvidersMode", wireType) - } - m.SelectedProvidersMode = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPolicy - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SelectedProvidersMode |= SELECTED_PROVIDERS_MODE(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SelectedProviders", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPolicy - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthPolicy - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPolicy - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SelectedProviders = append(m.SelectedProviders, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipPolicy(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPolicy - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ChainPolicy) 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 ErrIntOverflowPolicy - } - 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: ChainPolicy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChainPolicy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPolicy - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthPolicy - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPolicy - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Apis", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPolicy - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthPolicy - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPolicy - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Apis = append(m.Apis, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Requirements", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPolicy - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPolicy - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPolicy - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Requirements = append(m.Requirements, ChainRequirement{}) - if err := m.Requirements[len(m.Requirements)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipPolicy(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPolicy - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ChainRequirement) 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 ErrIntOverflowPolicy - } - 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: ChainRequirement: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChainRequirement: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Collection", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPolicy - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPolicy - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPolicy - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Collection.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Extensions", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPolicy - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthPolicy - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthPolicy - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Extensions = append(m.Extensions, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Mixed", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPolicy - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Mixed = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipPolicy(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPolicy - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipPolicy(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPolicy - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPolicy - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPolicy - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthPolicy - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupPolicy - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthPolicy - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthPolicy = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowPolicy = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupPolicy = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/plans/module.go b/x/plans/module.go index 51e5b60028..fd378e0f8a 100644 --- a/x/plans/module.go +++ b/x/plans/module.go @@ -124,32 +124,6 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { migrator := keeper.NewMigrator(am.keeper) - // register v2 -> v3 migration - if err := cfg.RegisterMigration(types.ModuleName, 2, migrator.Migrate2to3); err != nil { - // panic:ok: at start up, migration cannot proceed anyhow - panic(fmt.Errorf("%s: failed to register migration to v3: %w", types.ModuleName, err)) - } - // register v3 -> v4 migration - if err := cfg.RegisterMigration(types.ModuleName, 3, migrator.Migrate3to4); err != nil { - // panic:ok: at start up, migration cannot proceed anyhow - panic(fmt.Errorf("%s: failed to register migration to v4: %w", types.ModuleName, err)) - } - // register v4 -> v5 migration - if err := cfg.RegisterMigration(types.ModuleName, 4, migrator.Migrate4to5); err != nil { - // panic:ok: at start up, migration cannot proceed anyhow - panic(fmt.Errorf("%s: failed to register migration to v5: %w", types.ModuleName, err)) - } - // register v5 -> v6 migration - if err := cfg.RegisterMigration(types.ModuleName, 5, migrator.Migrate5to6); err != nil { - // panic:ok: at start up, migration cannot proceed anyhow - panic(fmt.Errorf("%s: failed to register migration to v6: %w", types.ModuleName, err)) - } - // register v6 -> v7 migration - if err := cfg.RegisterMigration(types.ModuleName, 6, migrator.Migrate6to7); err != nil { - // panic:ok: at start up, migration cannot proceed anyhow - panic(fmt.Errorf("%s: failed to register migration to v7: %w", types.ModuleName, err)) - } - // register v7 -> v8 migration if err := cfg.RegisterMigration(types.ModuleName, 7, migrator.Migrate7to8); err != nil { // panic:ok: at start up, migration cannot proceed anyhow diff --git a/x/plans/module_simulation.go b/x/plans/module_simulation.go deleted file mode 100644 index 229fc02022..0000000000 --- a/x/plans/module_simulation.go +++ /dev/null @@ -1,56 +0,0 @@ -package plans - -import ( - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/v4/testutil/sample" - plansimulation "github.com/lavanet/lava/v4/x/plans/simulation" - "github.com/lavanet/lava/v4/x/plans/types" -) - -// avoid unused import issue -var ( - _ = sample.AccAddress - _ = plansimulation.FindAccount - _ = sims.StakePerAccount - _ = simulation.MsgEntryKind - _ = baseapp.Paramspace -) - -const ( -// this line is used by starport scaffolding # simapp/module/const -) - -// GenerateGenesisState creates a randomized GenState of the module -func (AppModule) GenerateGenesisState(simState *module.SimulationState) { - accs := make([]string, len(simState.Accounts)) - for i, acc := range simState.Accounts { - accs[i] = acc.Address.String() - } - planGenesis := types.GenesisState{ - Params: types.DefaultParams(), - // this line is used by starport scaffolding # simapp/module/genesisState - } - simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&planGenesis) -} - -// ProposalContents doesn't return any content functions for governance proposals -func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalMsg { - return nil -} - -// RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} - -// WeightedOperations returns the all the gov module operations with their respective weights. -func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { - operations := make([]simtypes.WeightedOperation, 0) - - // this line is used by starport scaffolding # simapp/module/operation - - return operations -} diff --git a/x/plans/simulation/simap.go b/x/plans/simulation/simap.go deleted file mode 100644 index 92c437c0d1..0000000000 --- a/x/plans/simulation/simap.go +++ /dev/null @@ -1,15 +0,0 @@ -package simulation - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" -) - -// FindAccount find a specific address from an account list -func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { - creator, err := sdk.AccAddressFromBech32(address) - if err != nil { - panic(err) - } - return simtypes.FindAccount(accs, creator) -} diff --git a/x/projects/keeper/migrations.go b/x/projects/keeper/migrations.go index 614e364816..b593b2ebd5 100644 --- a/x/projects/keeper/migrations.go +++ b/x/projects/keeper/migrations.go @@ -2,11 +2,6 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/lavanet/lava/v4/utils" - v2 "github.com/lavanet/lava/v4/x/projects/migrations/v2" - v3 "github.com/lavanet/lava/v4/x/projects/migrations/v3" - v4 "github.com/lavanet/lava/v4/x/projects/migrations/v4" - v5 "github.com/lavanet/lava/v4/x/projects/migrations/v5" ) type Migrator struct { @@ -23,213 +18,6 @@ func (m Migrator) migrateFixationsVersion(ctx sdk.Context) error { return nil } -// Migrate2to3 implements store migration from v2 to v3: -// - Trigger version upgrade of the projectsFS, develooperKeysFS fixation stores -// - Update keys contents -func (m Migrator) Migrate2to3(ctx sdk.Context) error { - if err := m.migrateFixationsVersion(ctx); err != nil { - return err - } - - projectIndices := m.keeper.projectsFS.AllEntryIndicesFilter(ctx, "", nil) - for _, projectIndex := range projectIndices { - blocks := m.keeper.projectsFS.GetAllEntryVersions(ctx, projectIndex) - for _, block := range blocks { - var project_v2 v2.Project - m.keeper.projectsFS.ReadEntry(ctx, projectIndex, block, &project_v2) - - // convert project keys from type v2.ProjectKey to types.ProjectKey - var projectKeys_v3 []v3.ProjectKey - for _, projectKey_v2 := range project_v2.ProjectKeys { - projectKey_v3 := v3.ProjectKey{ - Key: projectKey_v2.Key, - } - - for _, projectKeyType_v2 := range projectKey_v2.Types { - if projectKeyType_v2 == v2.ProjectKey_ADMIN { - projectKey_v3.Types = append(projectKey_v3.Types, v3.ProjectKey_ADMIN) - } else if projectKeyType_v2 == v2.ProjectKey_DEVELOPER { - projectKey_v3.Types = append(projectKey_v3.Types, v3.ProjectKey_DEVELOPER) - } - } - } - - // convert chainPolicies from type v2.ChainPolicy to v3.ChainPolicy - var chainPolicies_v3 []v3.ChainPolicy - for _, chainPolicy_v2 := range project_v2.Policy.ChainPolicies { - chainPolicies_v3 = append(chainPolicies_v3, v3.ChainPolicy{ - ChainId: chainPolicy_v2.ChainId, - Apis: chainPolicy_v2.Apis, - }) - } - - // convert policy from type v2.Policy to v3.Policy - policy_v3 := v3.Policy{ - ChainPolicies: chainPolicies_v3, - GeolocationProfile: project_v2.Policy.GeolocationProfile, - TotalCuLimit: project_v2.Policy.TotalCuLimit, - EpochCuLimit: project_v2.Policy.EpochCuLimit, - MaxProvidersToPair: project_v2.Policy.MaxProvidersToPair, - } - - // convert project from type v2.Project to v3.Project - projectStruct_v3 := v3.Project{ - Index: project_v2.Index, - Subscription: project_v2.Subscription, - Description: project_v2.Description, - Enabled: project_v2.Enabled, - ProjectKeys: projectKeys_v3, - AdminPolicy: &policy_v3, - SubscriptionPolicy: &policy_v3, - UsedCu: project_v2.UsedCu, - } - - m.keeper.projectsFS.ModifyEntry(ctx, projectIndex, block, &projectStruct_v3) - } - } - - developerDataIndices := m.keeper.developerKeysFS.AllEntryIndicesFilter(ctx, "", nil) - for _, developerDataIndex := range developerDataIndices { - blocks := m.keeper.developerKeysFS.GetAllEntryVersions(ctx, developerDataIndex) - for _, block := range blocks { - var developerDataStruct_v2 v2.ProtoDeveloperData - m.keeper.developerKeysFS.ReadEntry(ctx, developerDataIndex, block, &developerDataStruct_v2) - - developerData_v3 := v3.ProtoDeveloperData{ - ProjectID: developerDataStruct_v2.ProjectID, - } - - m.keeper.developerKeysFS.ModifyEntry(ctx, developerDataIndex, block, &developerData_v3) - } - } - - return nil -} - -// Migrate3to4 implements store migration from v3 to v4: -// - Trigger version upgrade of the projectsFS, develooperKeysFS fixation-stores -func (m Migrator) Migrate3to4(ctx sdk.Context) error { - if err := m.migrateFixationsVersion(ctx); err != nil { - return err - } - return nil -} - -// Migrate4to5 implements store migration from v4 to v5: -// - Trigger version upgrade of the projectsFS, developerKeysFS fixation stores -// - Update keys types (from list of types to bitmap) -func (m Migrator) Migrate4to5(ctx sdk.Context) error { - if err := m.migrateFixationsVersion(ctx); err != nil { - return err - } - - projectIndices := m.keeper.projectsFS.GetAllEntryIndices(ctx) - for _, projectIndex := range projectIndices { - utils.LavaFormatDebug("migrate:", - utils.Attribute{Key: "project", Value: projectIndex}) - - blocks := m.keeper.projectsFS.GetAllEntryVersions(ctx, projectIndex) - for _, block := range blocks { - utils.LavaFormatDebug(" project:", - utils.Attribute{Key: "block", Value: block}) - - var project_v4 v4.Project - m.keeper.projectsFS.ReadEntry(ctx, projectIndex, block, &project_v4) - - // convert project keys from type v4.ProjectKey to v5.ProjectKey - var projectKeys_v5 []v5.ProjectKey - for _, projectKey_v4 := range project_v4.ProjectKeys { - utils.LavaFormatDebug(" block:", - utils.Attribute{Key: "key", Value: projectKey_v4}) - - projectKey_v5 := v5.NewProjectKey(projectKey_v4.Key, 0x0) - - for _, projectKeyType_v4 := range projectKey_v4.Types { - if projectKeyType_v4 == v4.ProjectKey_ADMIN { - projectKey_v5 = projectKey_v5.AddType(v5.ProjectKey_ADMIN) - } else if projectKeyType_v4 == v4.ProjectKey_DEVELOPER { - projectKey_v5 = projectKey_v5.AddType(v5.ProjectKey_DEVELOPER) - } - } - - projectKeys_v5 = append(projectKeys_v5, projectKey_v5) - } - - // convert policy from type v4.Policy to v5.Policy - // convert chainPolicies from type v4.ChainPolicy to v5.ChainPolicy - var adminPolicy_v5 *v5.Policy - if project_v4.AdminPolicy != nil { - var adminChainPolicies_v5 []v5.ChainPolicy - for _, chainPolicy_v4 := range project_v4.AdminPolicy.ChainPolicies { - adminChainPolicies_v5 = append(adminChainPolicies_v5, v5.ChainPolicy{ - ChainId: chainPolicy_v4.ChainId, - Apis: chainPolicy_v4.Apis, - }) - } - - adminPolicy_v5_temp := v5.Policy{ - ChainPolicies: adminChainPolicies_v5, - GeolocationProfile: project_v4.AdminPolicy.GeolocationProfile, - TotalCuLimit: project_v4.AdminPolicy.TotalCuLimit, - EpochCuLimit: project_v4.AdminPolicy.EpochCuLimit, - MaxProvidersToPair: project_v4.AdminPolicy.MaxProvidersToPair, - } - - adminPolicy_v5 = &adminPolicy_v5_temp - } - - var subscriptionPolicy_v5 *v5.Policy - if project_v4.SubscriptionPolicy != nil { - var subscriptionChainPolicies_v5 []v5.ChainPolicy - for _, chainPolicy_v4 := range project_v4.SubscriptionPolicy.ChainPolicies { - subscriptionChainPolicies_v5 = append(subscriptionChainPolicies_v5, v5.ChainPolicy{ - ChainId: chainPolicy_v4.ChainId, - Apis: chainPolicy_v4.Apis, - }) - } - - subscriptionPolicy_v5_temp := v5.Policy{ - ChainPolicies: subscriptionChainPolicies_v5, - GeolocationProfile: project_v4.SubscriptionPolicy.GeolocationProfile, - TotalCuLimit: project_v4.SubscriptionPolicy.TotalCuLimit, - EpochCuLimit: project_v4.SubscriptionPolicy.EpochCuLimit, - MaxProvidersToPair: project_v4.SubscriptionPolicy.MaxProvidersToPair, - } - - subscriptionPolicy_v5 = &subscriptionPolicy_v5_temp - } - - // convert project from type v4.Project to v5.Project - project_v5 := v5.Project{ - Index: project_v4.Index, - Subscription: project_v4.Subscription, - Description: project_v4.Description, - Enabled: project_v4.Enabled, - ProjectKeys: projectKeys_v5, - AdminPolicy: adminPolicy_v5, - SubscriptionPolicy: subscriptionPolicy_v5, - UsedCu: project_v4.UsedCu, - Snapshot: project_v4.Snapshot, - } - - utils.LavaFormatDebug(" project:", - utils.Attribute{Key: "entry_v4", Value: project_v4}) - utils.LavaFormatDebug(" project:", - utils.Attribute{Key: "entry_v5", Value: project_v5}) - - m.keeper.projectsFS.ModifyEntry(ctx, projectIndex, block, &project_v5) - } - } - - return nil -} - -// Migrate5to6 implements store migration from v5 to v6: -// -- trigger fixation migration, deleteat and live variables -func (m Migrator) Migrate5to6(ctx sdk.Context) error { - return m.migrateFixationsVersion(ctx) -} - // Migrate6to7 implements store migration from v6 to v7: // -- trigger fixation migration (v4->v5), initialize IsLatest field func (m Migrator) Migrate6to7(ctx sdk.Context) error { diff --git a/x/projects/migrations/v2/project.pb.go b/x/projects/migrations/v2/project.pb.go deleted file mode 100644 index 433b0bb3a1..0000000000 --- a/x/projects/migrations/v2/project.pb.go +++ /dev/null @@ -1,1755 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: projects/project.proto - -package types - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type ProjectKey_KEY_TYPE int32 - -const ( - ProjectKey_NONE ProjectKey_KEY_TYPE = 0 - ProjectKey_ADMIN ProjectKey_KEY_TYPE = 1 - ProjectKey_DEVELOPER ProjectKey_KEY_TYPE = 2 -) - -var ProjectKey_KEY_TYPE_name = map[int32]string{ - 0: "NONE", - 1: "ADMIN", - 2: "DEVELOPER", -} - -var ProjectKey_KEY_TYPE_value = map[string]int32{ - "NONE": 0, - "ADMIN": 1, - "DEVELOPER": 2, -} - -func (x ProjectKey_KEY_TYPE) String() string { - return proto.EnumName(ProjectKey_KEY_TYPE_name, int32(x)) -} - -func (ProjectKey_KEY_TYPE) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{1, 0} -} - -type Project struct { - Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` - Subscription string `protobuf:"bytes,2,opt,name=subscription,proto3" json:"subscription,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"` - ProjectKeys []ProjectKey `protobuf:"bytes,5,rep,name=project_keys,json=projectKeys,proto3" json:"project_keys"` - Policy Policy `protobuf:"bytes,6,opt,name=policy,proto3" json:"policy"` - UsedCu uint64 `protobuf:"varint,7,opt,name=used_cu,json=usedCu,proto3" json:"used_cu,omitempty"` -} - -func (m *Project) Reset() { *m = Project{} } -func (m *Project) String() string { return proto.CompactTextString(m) } -func (*Project) ProtoMessage() {} -func (*Project) Descriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{0} -} -func (m *Project) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Project) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Project.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 *Project) XXX_Merge(src proto.Message) { - xxx_messageInfo_Project.Merge(m, src) -} -func (m *Project) XXX_Size() int { - return m.Size() -} -func (m *Project) XXX_DiscardUnknown() { - xxx_messageInfo_Project.DiscardUnknown(m) -} - -var xxx_messageInfo_Project proto.InternalMessageInfo - -func (m *Project) GetIndex() string { - if m != nil { - return m.Index - } - return "" -} - -func (m *Project) GetSubscription() string { - if m != nil { - return m.Subscription - } - return "" -} - -func (m *Project) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *Project) GetEnabled() bool { - if m != nil { - return m.Enabled - } - return false -} - -func (m *Project) GetProjectKeys() []ProjectKey { - if m != nil { - return m.ProjectKeys - } - return nil -} - -func (m *Project) GetPolicy() Policy { - if m != nil { - return m.Policy - } - return Policy{} -} - -func (m *Project) GetUsedCu() uint64 { - if m != nil { - return m.UsedCu - } - return 0 -} - -type ProjectKey struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Types []ProjectKey_KEY_TYPE `protobuf:"varint,2,rep,packed,name=types,proto3,enum=lavanet.lava.projects.ProjectKey_KEY_TYPE" json:"types,omitempty"` - Vrfpk string `protobuf:"bytes,3,opt,name=vrfpk,proto3" json:"vrfpk,omitempty"` -} - -func (m *ProjectKey) Reset() { *m = ProjectKey{} } -func (m *ProjectKey) String() string { return proto.CompactTextString(m) } -func (*ProjectKey) ProtoMessage() {} -func (*ProjectKey) Descriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{1} -} -func (m *ProjectKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProjectKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProjectKey.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 *ProjectKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProjectKey.Merge(m, src) -} -func (m *ProjectKey) XXX_Size() int { - return m.Size() -} -func (m *ProjectKey) XXX_DiscardUnknown() { - xxx_messageInfo_ProjectKey.DiscardUnknown(m) -} - -var xxx_messageInfo_ProjectKey proto.InternalMessageInfo - -func (m *ProjectKey) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *ProjectKey) GetTypes() []ProjectKey_KEY_TYPE { - if m != nil { - return m.Types - } - return nil -} - -func (m *ProjectKey) GetVrfpk() string { - if m != nil { - return m.Vrfpk - } - return "" -} - -type Policy struct { - ChainPolicies []ChainPolicy `protobuf:"bytes,1,rep,name=chain_policies,json=chainPolicies,proto3" json:"chain_policies"` - GeolocationProfile uint64 `protobuf:"varint,2,opt,name=geolocation_profile,json=geolocationProfile,proto3" json:"geolocation_profile,omitempty"` - TotalCuLimit uint64 `protobuf:"varint,3,opt,name=total_cu_limit,json=totalCuLimit,proto3" json:"total_cu_limit,omitempty"` - EpochCuLimit uint64 `protobuf:"varint,4,opt,name=epoch_cu_limit,json=epochCuLimit,proto3" json:"epoch_cu_limit,omitempty"` - MaxProvidersToPair uint64 `protobuf:"varint,5,opt,name=max_providers_to_pair,json=maxProvidersToPair,proto3" json:"max_providers_to_pair,omitempty"` -} - -func (m *Policy) Reset() { *m = Policy{} } -func (m *Policy) String() string { return proto.CompactTextString(m) } -func (*Policy) ProtoMessage() {} -func (*Policy) Descriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{2} -} -func (m *Policy) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Policy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Policy.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 *Policy) XXX_Merge(src proto.Message) { - xxx_messageInfo_Policy.Merge(m, src) -} -func (m *Policy) XXX_Size() int { - return m.Size() -} -func (m *Policy) XXX_DiscardUnknown() { - xxx_messageInfo_Policy.DiscardUnknown(m) -} - -var xxx_messageInfo_Policy proto.InternalMessageInfo - -func (m *Policy) GetChainPolicies() []ChainPolicy { - if m != nil { - return m.ChainPolicies - } - return nil -} - -func (m *Policy) GetGeolocationProfile() uint64 { - if m != nil { - return m.GeolocationProfile - } - return 0 -} - -func (m *Policy) GetTotalCuLimit() uint64 { - if m != nil { - return m.TotalCuLimit - } - return 0 -} - -func (m *Policy) GetEpochCuLimit() uint64 { - if m != nil { - return m.EpochCuLimit - } - return 0 -} - -func (m *Policy) GetMaxProvidersToPair() uint64 { - if m != nil { - return m.MaxProvidersToPair - } - return 0 -} - -type ChainPolicy struct { - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - Apis []string `protobuf:"bytes,2,rep,name=apis,proto3" json:"apis,omitempty"` -} - -func (m *ChainPolicy) Reset() { *m = ChainPolicy{} } -func (m *ChainPolicy) String() string { return proto.CompactTextString(m) } -func (*ChainPolicy) ProtoMessage() {} -func (*ChainPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{3} -} -func (m *ChainPolicy) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ChainPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChainPolicy.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 *ChainPolicy) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChainPolicy.Merge(m, src) -} -func (m *ChainPolicy) XXX_Size() int { - return m.Size() -} -func (m *ChainPolicy) XXX_DiscardUnknown() { - xxx_messageInfo_ChainPolicy.DiscardUnknown(m) -} - -var xxx_messageInfo_ChainPolicy proto.InternalMessageInfo - -func (m *ChainPolicy) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - -func (m *ChainPolicy) GetApis() []string { - if m != nil { - return m.Apis - } - return nil -} - -type ProtoDeveloperData struct { - ProjectID string `protobuf:"bytes,1,opt,name=projectID,proto3" json:"projectID,omitempty"` - Vrfpk string `protobuf:"bytes,2,opt,name=vrfpk,proto3" json:"vrfpk,omitempty"` -} - -func (m *ProtoDeveloperData) Reset() { *m = ProtoDeveloperData{} } -func (m *ProtoDeveloperData) String() string { return proto.CompactTextString(m) } -func (*ProtoDeveloperData) ProtoMessage() {} -func (*ProtoDeveloperData) Descriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{4} -} -func (m *ProtoDeveloperData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProtoDeveloperData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProtoDeveloperData.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 *ProtoDeveloperData) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProtoDeveloperData.Merge(m, src) -} -func (m *ProtoDeveloperData) XXX_Size() int { - return m.Size() -} -func (m *ProtoDeveloperData) XXX_DiscardUnknown() { - xxx_messageInfo_ProtoDeveloperData.DiscardUnknown(m) -} - -var xxx_messageInfo_ProtoDeveloperData proto.InternalMessageInfo - -func (m *ProtoDeveloperData) GetProjectID() string { - if m != nil { - return m.ProjectID - } - return "" -} - -func (m *ProtoDeveloperData) GetVrfpk() string { - if m != nil { - return m.Vrfpk - } - return "" -} - -func init() { - proto.RegisterEnum("lavanet.lava.projects.ProjectKey_KEY_TYPE_V2", ProjectKey_KEY_TYPE_name, ProjectKey_KEY_TYPE_value) - proto.RegisterType((*Project)(nil), "lavanet.lava.projects.Project_V2") - proto.RegisterType((*ProjectKey)(nil), "lavanet.lava.projects.ProjectKey_V2") - proto.RegisterType((*Policy)(nil), "lavanet.lava.projects.Policy_V2") - proto.RegisterType((*ChainPolicy)(nil), "lavanet.lava.projects.ChainPolicy_V2") - proto.RegisterType((*ProtoDeveloperData)(nil), "lavanet.lava.projects.ProtoDeveloperData_V2") -} - -func init() { proto.RegisterFile("projects/project.proto", fileDescriptor_9f89a31663a330ce) } - -var fileDescriptor_9f89a31663a330ce = []byte{ - // 593 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0xc7, 0x63, 0xc7, 0xf9, 0x9a, 0xb4, 0x55, 0xb4, 0xb4, 0x60, 0x10, 0x18, 0x63, 0x71, 0xb0, - 0x38, 0xd8, 0xa2, 0x1c, 0x39, 0x91, 0xc6, 0x88, 0xd2, 0xd2, 0x5a, 0x56, 0x85, 0x54, 0x2e, 0xd6, - 0xc6, 0xde, 0xa6, 0x4b, 0x9d, 0xec, 0xca, 0x1f, 0x51, 0xf2, 0x08, 0xdc, 0x78, 0x05, 0xee, 0x3c, - 0x48, 0x8f, 0x3d, 0x72, 0x42, 0xa8, 0x79, 0x11, 0xe4, 0xf5, 0xe6, 0xa3, 0x12, 0x15, 0x27, 0xef, - 0xfc, 0xe7, 0xe7, 0xdd, 0x99, 0xf9, 0xef, 0xc2, 0x43, 0x9e, 0xb2, 0xaf, 0x24, 0xca, 0x33, 0x57, - 0x2e, 0x1c, 0x9e, 0xb2, 0x9c, 0xa1, 0xbd, 0x04, 0x4f, 0xf1, 0x84, 0xe4, 0x4e, 0xf9, 0x75, 0x96, - 0xd0, 0x93, 0xdd, 0x11, 0x1b, 0x31, 0x41, 0xb8, 0xe5, 0xaa, 0x82, 0xad, 0x1f, 0x2a, 0xb4, 0xfc, - 0x0a, 0x41, 0xbb, 0xd0, 0xa0, 0x93, 0x98, 0xcc, 0x74, 0xc5, 0x54, 0xec, 0x4e, 0x50, 0x05, 0xc8, - 0x82, 0xad, 0xac, 0x18, 0x66, 0x51, 0x4a, 0x79, 0x4e, 0xd9, 0x44, 0x57, 0x45, 0xf2, 0x8e, 0x86, - 0x4c, 0xe8, 0xc6, 0x64, 0x8d, 0xd4, 0x05, 0xb2, 0x29, 0x21, 0x1d, 0x5a, 0x64, 0x82, 0x87, 0x09, - 0x89, 0x75, 0xcd, 0x54, 0xec, 0x76, 0xb0, 0x0c, 0xd1, 0x47, 0xd8, 0x92, 0x35, 0x86, 0x57, 0x64, - 0x9e, 0xe9, 0x0d, 0xb3, 0x6e, 0x77, 0xf7, 0x5f, 0x38, 0xff, 0xec, 0xc2, 0x91, 0xb5, 0x1e, 0x91, - 0x79, 0x5f, 0xbb, 0xfe, 0xfd, 0xbc, 0x16, 0x74, 0xf9, 0x4a, 0xc9, 0xd0, 0x5b, 0x68, 0x72, 0x96, - 0xd0, 0x68, 0xae, 0x37, 0x4d, 0xc5, 0xee, 0xee, 0x3f, 0xbb, 0x6f, 0x17, 0x01, 0xc9, 0x1d, 0xe4, - 0x2f, 0xe8, 0x11, 0xb4, 0x8a, 0x8c, 0xc4, 0x61, 0x54, 0xe8, 0x2d, 0x53, 0xb1, 0xb5, 0xa0, 0x59, - 0x86, 0x07, 0x85, 0xf5, 0x53, 0x01, 0x58, 0x9f, 0x8b, 0x7a, 0x50, 0xbf, 0x22, 0x73, 0x39, 0xa4, - 0x72, 0x89, 0xde, 0x43, 0x23, 0x9f, 0x73, 0x92, 0xe9, 0xaa, 0x59, 0xb7, 0x77, 0xf6, 0x5f, 0xfd, - 0xb7, 0x76, 0xe7, 0xc8, 0x3b, 0x0f, 0xcf, 0xce, 0x7d, 0x4f, 0x96, 0x50, 0xfd, 0x5e, 0x1a, 0x30, - 0x4d, 0x2f, 0xf8, 0x95, 0x1c, 0x60, 0x15, 0x58, 0x0e, 0xb4, 0x97, 0x38, 0x6a, 0x83, 0x76, 0x72, - 0x7a, 0xe2, 0xf5, 0x6a, 0xa8, 0x03, 0x8d, 0x77, 0x83, 0x4f, 0x87, 0x27, 0x3d, 0x05, 0x6d, 0x43, - 0x67, 0xe0, 0x7d, 0xf6, 0x8e, 0x4f, 0x7d, 0x2f, 0xe8, 0xa9, 0xd6, 0x37, 0x15, 0x9a, 0x55, 0x83, - 0xe8, 0x14, 0x76, 0xa2, 0x4b, 0x4c, 0x27, 0xa1, 0x68, 0x91, 0x92, 0x4c, 0x57, 0xc4, 0x74, 0xad, - 0x7b, 0x2a, 0x3c, 0x28, 0xe1, 0x3b, 0xc3, 0xd9, 0x8e, 0x56, 0x12, 0x25, 0x19, 0x72, 0xe1, 0xc1, - 0x88, 0xb0, 0x84, 0x45, 0xb8, 0x74, 0x35, 0xe4, 0x29, 0xbb, 0xa0, 0x09, 0x11, 0x77, 0x42, 0x0b, - 0xd0, 0x46, 0xca, 0xaf, 0x32, 0xe8, 0x25, 0xec, 0xe4, 0x2c, 0xc7, 0x49, 0x18, 0x15, 0x61, 0x42, - 0xc7, 0x34, 0x17, 0xbd, 0x69, 0xc1, 0x96, 0x50, 0x0f, 0x8a, 0xe3, 0x52, 0x2b, 0x29, 0xc2, 0x59, - 0x74, 0xb9, 0xa6, 0xb4, 0x8a, 0x12, 0xea, 0x92, 0x7a, 0x0d, 0x7b, 0x63, 0x3c, 0x2b, 0x0f, 0x9d, - 0xd2, 0x98, 0xa4, 0x59, 0x98, 0xb3, 0x90, 0x63, 0x9a, 0xea, 0x8d, 0xea, 0xf8, 0x31, 0x9e, 0xf9, - 0xcb, 0xdc, 0x19, 0xf3, 0x31, 0x4d, 0xad, 0x3e, 0x74, 0x37, 0x7a, 0x42, 0x8f, 0xa1, 0x5d, 0xcd, - 0x83, 0xc6, 0xd2, 0xbf, 0x96, 0x88, 0x0f, 0x63, 0xa4, 0x83, 0x86, 0x39, 0xad, 0x2c, 0xec, 0xc8, - 0xe6, 0x85, 0x62, 0x7d, 0x00, 0xe4, 0x97, 0x6f, 0x65, 0x40, 0xa6, 0x24, 0x61, 0x9c, 0xa4, 0x03, - 0x9c, 0x63, 0xf4, 0x14, 0x3a, 0x72, 0x6c, 0x87, 0x03, 0xb9, 0xd7, 0x5a, 0x58, 0x3b, 0xa9, 0x6e, - 0x38, 0xd9, 0xef, 0x5f, 0xdf, 0x1a, 0xca, 0xcd, 0xad, 0xa1, 0xfc, 0xb9, 0x35, 0x94, 0xef, 0x0b, - 0xa3, 0x76, 0xb3, 0x30, 0x6a, 0xbf, 0x16, 0x46, 0xed, 0x8b, 0x3d, 0xa2, 0xf9, 0x65, 0x31, 0x74, - 0x22, 0x36, 0x76, 0xa5, 0x35, 0xe2, 0xeb, 0xce, 0xdc, 0xd5, 0x2b, 0x17, 0x77, 0x64, 0xd8, 0x14, - 0xef, 0xf6, 0xcd, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa8, 0xe0, 0xc7, 0x3c, 0xfe, 0x03, 0x00, - 0x00, -} - -func (m *Project) 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 *Project) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Project) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.UsedCu != 0 { - i = encodeVarintProject(dAtA, i, uint64(m.UsedCu)) - i-- - dAtA[i] = 0x38 - } - { - size, err := m.Policy.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProject(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - if len(m.ProjectKeys) > 0 { - for iNdEx := len(m.ProjectKeys) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ProjectKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProject(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if m.Enabled { - i-- - if m.Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintProject(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x1a - } - if len(m.Subscription) > 0 { - i -= len(m.Subscription) - copy(dAtA[i:], m.Subscription) - i = encodeVarintProject(dAtA, i, uint64(len(m.Subscription))) - i-- - dAtA[i] = 0x12 - } - if len(m.Index) > 0 { - i -= len(m.Index) - copy(dAtA[i:], m.Index) - i = encodeVarintProject(dAtA, i, uint64(len(m.Index))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ProjectKey) 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 *ProjectKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProjectKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Vrfpk) > 0 { - i -= len(m.Vrfpk) - copy(dAtA[i:], m.Vrfpk) - i = encodeVarintProject(dAtA, i, uint64(len(m.Vrfpk))) - i-- - dAtA[i] = 0x1a - } - if len(m.Types) > 0 { - dAtA3 := make([]byte, len(m.Types)*10) - var j2 int - for _, num := range m.Types { - for num >= 1<<7 { - dAtA3[j2] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j2++ - } - dAtA3[j2] = uint8(num) - j2++ - } - i -= j2 - copy(dAtA[i:], dAtA3[:j2]) - i = encodeVarintProject(dAtA, i, uint64(j2)) - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintProject(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Policy) 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 *Policy) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Policy) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.MaxProvidersToPair != 0 { - i = encodeVarintProject(dAtA, i, uint64(m.MaxProvidersToPair)) - i-- - dAtA[i] = 0x28 - } - if m.EpochCuLimit != 0 { - i = encodeVarintProject(dAtA, i, uint64(m.EpochCuLimit)) - i-- - dAtA[i] = 0x20 - } - if m.TotalCuLimit != 0 { - i = encodeVarintProject(dAtA, i, uint64(m.TotalCuLimit)) - i-- - dAtA[i] = 0x18 - } - if m.GeolocationProfile != 0 { - i = encodeVarintProject(dAtA, i, uint64(m.GeolocationProfile)) - i-- - dAtA[i] = 0x10 - } - if len(m.ChainPolicies) > 0 { - for iNdEx := len(m.ChainPolicies) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ChainPolicies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProject(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ChainPolicy) 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 *ChainPolicy) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChainPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Apis) > 0 { - for iNdEx := len(m.Apis) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Apis[iNdEx]) - copy(dAtA[i:], m.Apis[iNdEx]) - i = encodeVarintProject(dAtA, i, uint64(len(m.Apis[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintProject(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ProtoDeveloperData) 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 *ProtoDeveloperData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProtoDeveloperData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Vrfpk) > 0 { - i -= len(m.Vrfpk) - copy(dAtA[i:], m.Vrfpk) - i = encodeVarintProject(dAtA, i, uint64(len(m.Vrfpk))) - i-- - dAtA[i] = 0x12 - } - if len(m.ProjectID) > 0 { - i -= len(m.ProjectID) - copy(dAtA[i:], m.ProjectID) - i = encodeVarintProject(dAtA, i, uint64(len(m.ProjectID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintProject(dAtA []byte, offset int, v uint64) int { - offset -= sovProject(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Project) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Index) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - l = len(m.Subscription) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - if m.Enabled { - n += 2 - } - if len(m.ProjectKeys) > 0 { - for _, e := range m.ProjectKeys { - l = e.Size() - n += 1 + l + sovProject(uint64(l)) - } - } - l = m.Policy.Size() - n += 1 + l + sovProject(uint64(l)) - if m.UsedCu != 0 { - n += 1 + sovProject(uint64(m.UsedCu)) - } - return n -} - -func (m *ProjectKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - if len(m.Types) > 0 { - l = 0 - for _, e := range m.Types { - l += sovProject(uint64(e)) - } - n += 1 + sovProject(uint64(l)) + l - } - l = len(m.Vrfpk) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - return n -} - -func (m *Policy) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ChainPolicies) > 0 { - for _, e := range m.ChainPolicies { - l = e.Size() - n += 1 + l + sovProject(uint64(l)) - } - } - if m.GeolocationProfile != 0 { - n += 1 + sovProject(uint64(m.GeolocationProfile)) - } - if m.TotalCuLimit != 0 { - n += 1 + sovProject(uint64(m.TotalCuLimit)) - } - if m.EpochCuLimit != 0 { - n += 1 + sovProject(uint64(m.EpochCuLimit)) - } - if m.MaxProvidersToPair != 0 { - n += 1 + sovProject(uint64(m.MaxProvidersToPair)) - } - return n -} - -func (m *ChainPolicy) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - if len(m.Apis) > 0 { - for _, s := range m.Apis { - l = len(s) - n += 1 + l + sovProject(uint64(l)) - } - } - return n -} - -func (m *ProtoDeveloperData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ProjectID) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - l = len(m.Vrfpk) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - return n -} - -func sovProject(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozProject(x uint64) (n int) { - return sovProject(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Project) 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 ErrIntOverflowProject - } - 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: Project: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Project: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Index = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subscription", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Subscription = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Enabled = bool(v != 0) - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProjectKeys", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProjectKeys = append(m.ProjectKeys, ProjectKey{}) - if err := m.ProjectKeys[len(m.ProjectKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Policy", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Policy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UsedCu", wireType) - } - m.UsedCu = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.UsedCu |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipProject(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProject - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProjectKey) 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 ErrIntOverflowProject - } - 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: ProjectKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProjectKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType == 0 { - var v ProjectKey_KEY_TYPE - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= ProjectKey_KEY_TYPE(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Types = append(m.Types, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - if elementCount != 0 && len(m.Types) == 0 { - m.Types = make([]ProjectKey_KEY_TYPE, 0, elementCount) - } - for iNdEx < postIndex { - var v ProjectKey_KEY_TYPE - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= ProjectKey_KEY_TYPE(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Types = append(m.Types, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Types", wireType) - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Vrfpk", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Vrfpk = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProject(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProject - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Policy) 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 ErrIntOverflowProject - } - 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: Policy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Policy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainPolicies", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainPolicies = append(m.ChainPolicies, ChainPolicy{}) - if err := m.ChainPolicies[len(m.ChainPolicies)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GeolocationProfile", wireType) - } - m.GeolocationProfile = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GeolocationProfile |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalCuLimit", wireType) - } - m.TotalCuLimit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalCuLimit |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochCuLimit", wireType) - } - m.EpochCuLimit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EpochCuLimit |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxProvidersToPair", wireType) - } - m.MaxProvidersToPair = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxProvidersToPair |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipProject(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProject - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ChainPolicy) 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 ErrIntOverflowProject - } - 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: ChainPolicy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChainPolicy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Apis", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Apis = append(m.Apis, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProject(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProject - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProtoDeveloperData) 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 ErrIntOverflowProject - } - 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: ProtoDeveloperData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProtoDeveloperData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProjectID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProjectID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Vrfpk", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Vrfpk = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProject(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProject - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipProject(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProject - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProject - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProject - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthProject - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupProject - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthProject - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthProject = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowProject = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupProject = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/projects/migrations/v3/project.pb.go b/x/projects/migrations/v3/project.pb.go deleted file mode 100644 index a29c1ebfe9..0000000000 --- a/x/projects/migrations/v3/project.pb.go +++ /dev/null @@ -1,2375 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: projects/project.proto - -package types - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type ProjectKey_KEY_TYPE int32 - -const ( - ProjectKey_NONE ProjectKey_KEY_TYPE = 0 - ProjectKey_ADMIN ProjectKey_KEY_TYPE = 1 - ProjectKey_DEVELOPER ProjectKey_KEY_TYPE = 2 -) - -var ProjectKey_KEY_TYPE_name = map[int32]string{ - 0: "NONE", - 1: "ADMIN", - 2: "DEVELOPER", -} - -var ProjectKey_KEY_TYPE_value = map[string]int32{ - "NONE": 0, - "ADMIN": 1, - "DEVELOPER": 2, -} - -func (x ProjectKey_KEY_TYPE) String() string { - return proto.EnumName(ProjectKey_KEY_TYPE_name, int32(x)) -} - -func (ProjectKey_KEY_TYPE) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{1, 0} -} - -type Project struct { - Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` - Subscription string `protobuf:"bytes,2,opt,name=subscription,proto3" json:"subscription,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"` - ProjectKeys []ProjectKey `protobuf:"bytes,5,rep,name=project_keys,json=projectKeys,proto3" json:"project_keys"` - AdminPolicy *Policy `protobuf:"bytes,6,opt,name=admin_policy,json=adminPolicy,proto3" json:"admin_policy,omitempty"` - UsedCu uint64 `protobuf:"varint,7,opt,name=used_cu,json=usedCu,proto3" json:"used_cu,omitempty"` - SubscriptionPolicy *Policy `protobuf:"bytes,8,opt,name=subscription_policy,json=subscriptionPolicy,proto3" json:"subscription_policy,omitempty"` - Snapshot uint64 `protobuf:"varint,9,opt,name=snapshot,proto3" json:"snapshot,omitempty"` -} - -func (m *Project) Reset() { *m = Project{} } -func (m *Project) String() string { return proto.CompactTextString(m) } -func (*Project) ProtoMessage() {} -func (*Project) Descriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{0} -} -func (m *Project) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Project) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Project.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 *Project) XXX_Merge(src proto.Message) { - xxx_messageInfo_Project.Merge(m, src) -} -func (m *Project) XXX_Size() int { - return m.Size() -} -func (m *Project) XXX_DiscardUnknown() { - xxx_messageInfo_Project.DiscardUnknown(m) -} - -var xxx_messageInfo_Project proto.InternalMessageInfo - -func (m *Project) GetIndex() string { - if m != nil { - return m.Index - } - return "" -} - -func (m *Project) GetSubscription() string { - if m != nil { - return m.Subscription - } - return "" -} - -func (m *Project) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *Project) GetEnabled() bool { - if m != nil { - return m.Enabled - } - return false -} - -func (m *Project) GetProjectKeys() []ProjectKey { - if m != nil { - return m.ProjectKeys - } - return nil -} - -func (m *Project) GetAdminPolicy() *Policy { - if m != nil { - return m.AdminPolicy - } - return nil -} - -func (m *Project) GetUsedCu() uint64 { - if m != nil { - return m.UsedCu - } - return 0 -} - -func (m *Project) GetSubscriptionPolicy() *Policy { - if m != nil { - return m.SubscriptionPolicy - } - return nil -} - -func (m *Project) GetSnapshot() uint64 { - if m != nil { - return m.Snapshot - } - return 0 -} - -type ProjectKey struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Types []ProjectKey_KEY_TYPE `protobuf:"varint,2,rep,packed,name=types,proto3,enum=lavanet.lava.projects.ProjectKey_KEY_TYPE" json:"types,omitempty"` -} - -func (m *ProjectKey) Reset() { *m = ProjectKey{} } -func (m *ProjectKey) String() string { return proto.CompactTextString(m) } -func (*ProjectKey) ProtoMessage() {} -func (*ProjectKey) Descriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{1} -} -func (m *ProjectKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProjectKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProjectKey.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 *ProjectKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProjectKey.Merge(m, src) -} -func (m *ProjectKey) XXX_Size() int { - return m.Size() -} -func (m *ProjectKey) XXX_DiscardUnknown() { - xxx_messageInfo_ProjectKey.DiscardUnknown(m) -} - -var xxx_messageInfo_ProjectKey proto.InternalMessageInfo - -func (m *ProjectKey) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *ProjectKey) GetTypes() []ProjectKey_KEY_TYPE { - if m != nil { - return m.Types - } - return nil -} - -// protobuf expected in YAML format: used "moretags" to simplify parsing -type Policy struct { - ChainPolicies []ChainPolicy `protobuf:"bytes,1,rep,name=chain_policies,json=chainPolicies,proto3" json:"chain_policies" mapstructure:"chain_policies"` - GeolocationProfile uint64 `protobuf:"varint,2,opt,name=geolocation_profile,json=geolocationProfile,proto3" json:"geolocation_profile" mapstructure:"geolocation_profile"` - TotalCuLimit uint64 `protobuf:"varint,3,opt,name=total_cu_limit,json=totalCuLimit,proto3" json:"total_cu_limit" mapstructure:"total_cu_limit"` - EpochCuLimit uint64 `protobuf:"varint,4,opt,name=epoch_cu_limit,json=epochCuLimit,proto3" json:"epoch_cu_limit" mapstructure:"epoch_cu_limit"` - MaxProvidersToPair uint64 `protobuf:"varint,5,opt,name=max_providers_to_pair,json=maxProvidersToPair,proto3" json:"max_providers_to_pair" mapstructure:"max_providers_to_pair"` -} - -func (m *Policy) Reset() { *m = Policy{} } -func (m *Policy) String() string { return proto.CompactTextString(m) } -func (*Policy) ProtoMessage() {} -func (*Policy) Descriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{2} -} -func (m *Policy) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Policy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Policy.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 *Policy) XXX_Merge(src proto.Message) { - xxx_messageInfo_Policy.Merge(m, src) -} -func (m *Policy) XXX_Size() int { - return m.Size() -} -func (m *Policy) XXX_DiscardUnknown() { - xxx_messageInfo_Policy.DiscardUnknown(m) -} - -var xxx_messageInfo_Policy proto.InternalMessageInfo - -func (m *Policy) GetChainPolicies() []ChainPolicy { - if m != nil { - return m.ChainPolicies - } - return nil -} - -func (m *Policy) GetGeolocationProfile() uint64 { - if m != nil { - return m.GeolocationProfile - } - return 0 -} - -func (m *Policy) GetTotalCuLimit() uint64 { - if m != nil { - return m.TotalCuLimit - } - return 0 -} - -func (m *Policy) GetEpochCuLimit() uint64 { - if m != nil { - return m.EpochCuLimit - } - return 0 -} - -func (m *Policy) GetMaxProvidersToPair() uint64 { - if m != nil { - return m.MaxProvidersToPair - } - return 0 -} - -type ChainPolicy struct { - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty" mapstructure:"chain_id"` - Apis []string `protobuf:"bytes,2,rep,name=apis,proto3" json:"apis,omitempty" mapstructure:"apis"` -} - -func (m *ChainPolicy) Reset() { *m = ChainPolicy{} } -func (m *ChainPolicy) String() string { return proto.CompactTextString(m) } -func (*ChainPolicy) ProtoMessage() {} -func (*ChainPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{3} -} -func (m *ChainPolicy) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ChainPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChainPolicy.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 *ChainPolicy) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChainPolicy.Merge(m, src) -} -func (m *ChainPolicy) XXX_Size() int { - return m.Size() -} -func (m *ChainPolicy) XXX_DiscardUnknown() { - xxx_messageInfo_ChainPolicy.DiscardUnknown(m) -} - -var xxx_messageInfo_ChainPolicy proto.InternalMessageInfo - -func (m *ChainPolicy) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - -func (m *ChainPolicy) GetApis() []string { - if m != nil { - return m.Apis - } - return nil -} - -type ProtoDeveloperData struct { - ProjectID string `protobuf:"bytes,1,opt,name=projectID,proto3" json:"projectID,omitempty"` -} - -func (m *ProtoDeveloperData) Reset() { *m = ProtoDeveloperData{} } -func (m *ProtoDeveloperData) String() string { return proto.CompactTextString(m) } -func (*ProtoDeveloperData) ProtoMessage() {} -func (*ProtoDeveloperData) Descriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{4} -} -func (m *ProtoDeveloperData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProtoDeveloperData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProtoDeveloperData.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 *ProtoDeveloperData) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProtoDeveloperData.Merge(m, src) -} -func (m *ProtoDeveloperData) XXX_Size() int { - return m.Size() -} -func (m *ProtoDeveloperData) XXX_DiscardUnknown() { - xxx_messageInfo_ProtoDeveloperData.DiscardUnknown(m) -} - -var xxx_messageInfo_ProtoDeveloperData proto.InternalMessageInfo - -func (m *ProtoDeveloperData) GetProjectID() string { - if m != nil { - return m.ProjectID - } - return "" -} - -// used as a container struct for the subscription module -type ProjectData struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Enabled bool `protobuf:"varint,3,opt,name=enabled,proto3" json:"enabled,omitempty"` - ProjectKeys []ProjectKey `protobuf:"bytes,4,rep,name=projectKeys,proto3" json:"projectKeys"` - Policy *Policy `protobuf:"bytes,5,opt,name=policy,proto3" json:"policy,omitempty"` -} - -func (m *ProjectData) Reset() { *m = ProjectData{} } -func (m *ProjectData) String() string { return proto.CompactTextString(m) } -func (*ProjectData) ProtoMessage() {} -func (*ProjectData) Descriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{5} -} -func (m *ProjectData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProjectData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProjectData.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 *ProjectData) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProjectData.Merge(m, src) -} -func (m *ProjectData) XXX_Size() int { - return m.Size() -} -func (m *ProjectData) XXX_DiscardUnknown() { - xxx_messageInfo_ProjectData.DiscardUnknown(m) -} - -var xxx_messageInfo_ProjectData proto.InternalMessageInfo - -func (m *ProjectData) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *ProjectData) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *ProjectData) GetEnabled() bool { - if m != nil { - return m.Enabled - } - return false -} - -func (m *ProjectData) GetProjectKeys() []ProjectKey { - if m != nil { - return m.ProjectKeys - } - return nil -} - -func (m *ProjectData) GetPolicy() *Policy { - if m != nil { - return m.Policy - } - return nil -} - -func init() { - proto.RegisterEnum("lavanet.lava.projects.ProjectKey_KEY_TYPE_V3", ProjectKey_KEY_TYPE_name, ProjectKey_KEY_TYPE_value) - proto.RegisterType((*Project)(nil), "lavanet.lava.projects.Project_V3") - proto.RegisterType((*ProjectKey)(nil), "lavanet.lava.projects.ProjectKey_V3") - proto.RegisterType((*Policy)(nil), "lavanet.lava.projects.Policy_V3") - proto.RegisterType((*ChainPolicy)(nil), "lavanet.lava.projects.ChainPolicy_V3") - proto.RegisterType((*ProtoDeveloperData)(nil), "lavanet.lava.projects.ProtoDeveloperData_V3") - proto.RegisterType((*ProjectData)(nil), "lavanet.lava.projects.ProjectData_V3") -} - -func init() { proto.RegisterFile("projects/project.proto", fileDescriptor_9f89a31663a330ce) } - -var fileDescriptor_9f89a31663a330ce = []byte{ - // 777 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4f, 0xab, 0xdb, 0x46, - 0x10, 0xb7, 0x2c, 0xd9, 0x96, 0xc7, 0xce, 0xc3, 0xec, 0x4b, 0x1a, 0x91, 0x34, 0x96, 0xbb, 0xb4, - 0x60, 0x7a, 0x90, 0xe1, 0x85, 0x96, 0x52, 0x28, 0x34, 0x7e, 0x76, 0xc0, 0x2f, 0xa9, 0x63, 0x44, - 0x28, 0xbc, 0x5e, 0xc4, 0x5a, 0xda, 0xda, 0xdb, 0xc8, 0x5a, 0xa1, 0x3f, 0xc6, 0xfe, 0x16, 0xa5, - 0x87, 0x9e, 0xfa, 0x01, 0xfa, 0x51, 0x72, 0xcc, 0xb1, 0x27, 0xb5, 0xf8, 0xdd, 0xde, 0xd1, 0x9f, - 0xa0, 0x68, 0x25, 0xff, 0x51, 0xe2, 0xb4, 0x81, 0x9c, 0x34, 0xf3, 0x9b, 0xdf, 0xcc, 0xec, 0xec, - 0x8c, 0x66, 0xe1, 0x13, 0x3f, 0xe0, 0xbf, 0x50, 0x3b, 0x0a, 0x7b, 0xb9, 0x60, 0xf8, 0x01, 0x8f, - 0x38, 0xba, 0xe7, 0x92, 0x25, 0xf1, 0x68, 0x64, 0xa4, 0x5f, 0x63, 0x47, 0x7a, 0x70, 0x77, 0xc6, - 0x67, 0x5c, 0x30, 0x7a, 0xa9, 0x94, 0x91, 0xf1, 0x6f, 0x32, 0xd4, 0x26, 0x19, 0x05, 0xdd, 0x85, - 0x0a, 0xf3, 0x1c, 0xba, 0xd2, 0xa4, 0x8e, 0xd4, 0xad, 0x9b, 0x99, 0x82, 0x30, 0x34, 0xc3, 0x78, - 0x1a, 0xda, 0x01, 0xf3, 0x23, 0xc6, 0x3d, 0xad, 0x2c, 0x8c, 0x05, 0x0c, 0x75, 0xa0, 0xe1, 0xd0, - 0x03, 0x45, 0x16, 0x94, 0x63, 0x08, 0x69, 0x50, 0xa3, 0x1e, 0x99, 0xba, 0xd4, 0xd1, 0x94, 0x8e, - 0xd4, 0x55, 0xcd, 0x9d, 0x8a, 0xae, 0xa0, 0x99, 0x9f, 0xd1, 0x7a, 0x45, 0xd7, 0xa1, 0x56, 0xe9, - 0xc8, 0xdd, 0xc6, 0xc5, 0x67, 0xc6, 0xc9, 0x2a, 0x8c, 0xfc, 0xac, 0xcf, 0xe8, 0xba, 0xaf, 0xbc, - 0x4e, 0xf4, 0x92, 0xd9, 0xf0, 0xf7, 0x48, 0x88, 0xbe, 0x87, 0x26, 0x71, 0x16, 0xcc, 0xb3, 0x7c, - 0xee, 0x32, 0x7b, 0xad, 0x55, 0x3b, 0x52, 0xb7, 0x71, 0xf1, 0xe8, 0x7d, 0xb1, 0x04, 0xc9, 0x6c, - 0x08, 0x97, 0x4c, 0x41, 0xf7, 0xa1, 0x16, 0x87, 0xd4, 0xb1, 0xec, 0x58, 0xab, 0x75, 0xa4, 0xae, - 0x62, 0x56, 0x53, 0xf5, 0x32, 0x46, 0x63, 0x38, 0x3f, 0x2e, 0x79, 0x97, 0x41, 0xfd, 0x90, 0x0c, - 0xe8, 0xd8, 0x33, 0x4f, 0xf4, 0x00, 0xd4, 0xd0, 0x23, 0x7e, 0x38, 0xe7, 0x91, 0x56, 0x17, 0x99, - 0xf6, 0x3a, 0xfe, 0x43, 0x02, 0x38, 0x14, 0x8a, 0x5a, 0x20, 0xbf, 0xa2, 0xeb, 0xbc, 0x2b, 0xa9, - 0x88, 0x9e, 0x42, 0x25, 0x5a, 0xfb, 0x34, 0xd4, 0xca, 0x1d, 0xb9, 0x7b, 0x76, 0xf1, 0xe5, 0xff, - 0x5e, 0x96, 0xf1, 0x6c, 0x78, 0x6d, 0xbd, 0xbc, 0x9e, 0x0c, 0xf3, 0x5b, 0xcb, 0xdc, 0xb1, 0x01, - 0xea, 0xce, 0x80, 0x54, 0x50, 0xc6, 0x2f, 0xc6, 0xc3, 0x56, 0x09, 0xd5, 0xa1, 0xf2, 0x64, 0xf0, - 0xc3, 0x68, 0xdc, 0x92, 0xd0, 0x1d, 0xa8, 0x0f, 0x86, 0x3f, 0x0e, 0x9f, 0xbf, 0x98, 0x0c, 0xcd, - 0x56, 0xf9, 0x4a, 0x51, 0xe5, 0x96, 0x82, 0x7f, 0x57, 0xa0, 0x9a, 0x57, 0xe1, 0xc3, 0x99, 0x3d, - 0x27, 0xbb, 0x0b, 0x67, 0x34, 0xd4, 0x24, 0xd1, 0x3e, 0xfc, 0x9e, 0x13, 0x5d, 0xa6, 0xe4, 0xcc, - 0xb7, 0xff, 0x45, 0x7a, 0x92, 0x6d, 0xa2, 0x3f, 0x5a, 0x10, 0x3f, 0x8c, 0x82, 0xd8, 0x8e, 0xe2, - 0x80, 0x7e, 0x8b, 0x8b, 0xf1, 0xb0, 0x79, 0xc7, 0xde, 0xfb, 0x30, 0x1a, 0x22, 0x0f, 0xce, 0x67, - 0x94, 0xbb, 0xdc, 0x26, 0x59, 0x1b, 0x02, 0xfe, 0x33, 0x73, 0xa9, 0x98, 0x4a, 0xa5, 0xff, 0xdd, - 0x6d, 0xa2, 0x9f, 0x32, 0x6f, 0x13, 0x1d, 0x17, 0xb3, 0x9c, 0x20, 0x61, 0x13, 0x1d, 0xa1, 0x93, - 0x0c, 0x44, 0xd7, 0x70, 0x16, 0xf1, 0x88, 0xb8, 0x96, 0x1d, 0x5b, 0x2e, 0x5b, 0xb0, 0x48, 0x4c, - 0xb7, 0xd2, 0x7f, 0x7c, 0x9b, 0xe8, 0x6f, 0x59, 0xde, 0xad, 0xa5, 0x68, 0xc7, 0x66, 0x53, 0x00, - 0x97, 0xf1, 0xf3, 0x54, 0x4d, 0x43, 0x53, 0x9f, 0xdb, 0xf3, 0x43, 0x68, 0xe5, 0x10, 0xba, 0x68, - 0x79, 0x37, 0x74, 0xd1, 0x8e, 0xcd, 0xa6, 0x00, 0x76, 0xa1, 0x23, 0xb8, 0xb7, 0x20, 0xab, 0xb4, - 0xb2, 0x25, 0x73, 0x68, 0x10, 0x5a, 0x11, 0xb7, 0x7c, 0xc2, 0x02, 0xad, 0x22, 0x32, 0x3c, 0xb9, - 0x4d, 0xf4, 0xd3, 0x84, 0x6d, 0xa2, 0x7f, 0x5e, 0x4c, 0x74, 0x92, 0x86, 0x4d, 0xb4, 0x20, 0xab, - 0xc9, 0x0e, 0x7e, 0xc9, 0x27, 0x29, 0xb8, 0x84, 0xc6, 0x51, 0x83, 0xd1, 0xd7, 0xa0, 0x66, 0xcd, - 0x64, 0x4e, 0x36, 0xbc, 0xfd, 0x87, 0xdb, 0x44, 0xbf, 0x7f, 0xaa, 0xdd, 0xcc, 0xc1, 0x66, 0x4d, - 0x88, 0x23, 0x07, 0xf5, 0x40, 0x21, 0x3e, 0xcb, 0x86, 0xbb, 0xde, 0x7f, 0x98, 0x8f, 0xc9, 0x79, - 0xd1, 0x2f, 0x65, 0x60, 0x53, 0x10, 0xf1, 0x37, 0x80, 0x26, 0xe9, 0x36, 0x1b, 0xd0, 0x25, 0x75, - 0xb9, 0x4f, 0x83, 0x01, 0x89, 0x08, 0xfa, 0x14, 0xea, 0xf9, 0xdc, 0x8d, 0x06, 0xf9, 0xcf, 0x73, - 0x00, 0xae, 0x14, 0xb5, 0xdc, 0x92, 0xf1, 0xdf, 0x12, 0x34, 0xf2, 0xbf, 0x44, 0xf8, 0x20, 0x50, - 0x3c, 0xb2, 0xa0, 0x39, 0x5d, 0xc8, 0x6f, 0x2f, 0xb7, 0xf2, 0x7f, 0x2e, 0x37, 0xb9, 0xb8, 0xdc, - 0x46, 0x70, 0xbc, 0x9f, 0x34, 0xe5, 0x23, 0x76, 0xdb, 0x57, 0x50, 0xcd, 0x77, 0x4e, 0xe5, 0x43, - 0x76, 0x4e, 0x4e, 0xee, 0x3f, 0xfd, 0x73, 0xd3, 0x96, 0x5e, 0x6f, 0xda, 0xd2, 0x9b, 0x4d, 0x5b, - 0xfa, 0x67, 0xd3, 0x96, 0x7e, 0xbd, 0x69, 0x97, 0xde, 0xdc, 0xb4, 0x4b, 0x7f, 0xdd, 0xb4, 0x4b, - 0x3f, 0x75, 0x67, 0x2c, 0x9a, 0xc7, 0x53, 0xc3, 0xe6, 0x8b, 0x5e, 0x1e, 0x4e, 0x7c, 0x7b, 0xab, - 0xde, 0xfe, 0x75, 0x11, 0xab, 0x62, 0x5a, 0x15, 0xef, 0xc5, 0xe3, 0x7f, 0x03, 0x00, 0x00, 0xff, - 0xff, 0xc4, 0x11, 0xe0, 0xc1, 0x76, 0x06, 0x00, 0x00, -} - -func (this *Project) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Project) - if !ok { - that2, ok := that.(Project) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Index != that1.Index { - return false - } - if this.Subscription != that1.Subscription { - return false - } - if this.Description != that1.Description { - return false - } - if this.Enabled != that1.Enabled { - return false - } - if len(this.ProjectKeys) != len(that1.ProjectKeys) { - return false - } - for i := range this.ProjectKeys { - if !this.ProjectKeys[i].Equal(&that1.ProjectKeys[i]) { - return false - } - } - if !this.AdminPolicy.Equal(that1.AdminPolicy) { - return false - } - if this.UsedCu != that1.UsedCu { - return false - } - if !this.SubscriptionPolicy.Equal(that1.SubscriptionPolicy) { - return false - } - if this.Snapshot != that1.Snapshot { - return false - } - return true -} -func (this *ProjectKey) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ProjectKey) - if !ok { - that2, ok := that.(ProjectKey) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Key != that1.Key { - return false - } - if len(this.Types) != len(that1.Types) { - return false - } - for i := range this.Types { - if this.Types[i] != that1.Types[i] { - return false - } - } - return true -} -func (this *Policy) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Policy) - if !ok { - that2, ok := that.(Policy) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.ChainPolicies) != len(that1.ChainPolicies) { - return false - } - for i := range this.ChainPolicies { - if !this.ChainPolicies[i].Equal(&that1.ChainPolicies[i]) { - return false - } - } - if this.GeolocationProfile != that1.GeolocationProfile { - return false - } - if this.TotalCuLimit != that1.TotalCuLimit { - return false - } - if this.EpochCuLimit != that1.EpochCuLimit { - return false - } - if this.MaxProvidersToPair != that1.MaxProvidersToPair { - return false - } - return true -} -func (this *ChainPolicy) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ChainPolicy) - if !ok { - that2, ok := that.(ChainPolicy) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ChainId != that1.ChainId { - return false - } - if len(this.Apis) != len(that1.Apis) { - return false - } - for i := range this.Apis { - if this.Apis[i] != that1.Apis[i] { - return false - } - } - return true -} -func (this *ProtoDeveloperData) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ProtoDeveloperData) - if !ok { - that2, ok := that.(ProtoDeveloperData) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ProjectID != that1.ProjectID { - return false - } - return true -} -func (this *ProjectData) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ProjectData) - if !ok { - that2, ok := that.(ProjectData) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if this.Description != that1.Description { - return false - } - if this.Enabled != that1.Enabled { - return false - } - if len(this.ProjectKeys) != len(that1.ProjectKeys) { - return false - } - for i := range this.ProjectKeys { - if !this.ProjectKeys[i].Equal(&that1.ProjectKeys[i]) { - return false - } - } - if !this.Policy.Equal(that1.Policy) { - return false - } - return true -} -func (m *Project) 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 *Project) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Project) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Snapshot != 0 { - i = encodeVarintProject(dAtA, i, uint64(m.Snapshot)) - i-- - dAtA[i] = 0x48 - } - if m.SubscriptionPolicy != nil { - { - size, err := m.SubscriptionPolicy.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProject(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if m.UsedCu != 0 { - i = encodeVarintProject(dAtA, i, uint64(m.UsedCu)) - i-- - dAtA[i] = 0x38 - } - if m.AdminPolicy != nil { - { - size, err := m.AdminPolicy.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProject(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if len(m.ProjectKeys) > 0 { - for iNdEx := len(m.ProjectKeys) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ProjectKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProject(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if m.Enabled { - i-- - if m.Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintProject(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x1a - } - if len(m.Subscription) > 0 { - i -= len(m.Subscription) - copy(dAtA[i:], m.Subscription) - i = encodeVarintProject(dAtA, i, uint64(len(m.Subscription))) - i-- - dAtA[i] = 0x12 - } - if len(m.Index) > 0 { - i -= len(m.Index) - copy(dAtA[i:], m.Index) - i = encodeVarintProject(dAtA, i, uint64(len(m.Index))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ProjectKey) 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 *ProjectKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProjectKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Types) > 0 { - dAtA4 := make([]byte, len(m.Types)*10) - var j3 int - for _, num := range m.Types { - for num >= 1<<7 { - dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j3++ - } - dAtA4[j3] = uint8(num) - j3++ - } - i -= j3 - copy(dAtA[i:], dAtA4[:j3]) - i = encodeVarintProject(dAtA, i, uint64(j3)) - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintProject(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Policy) 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 *Policy) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Policy) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.MaxProvidersToPair != 0 { - i = encodeVarintProject(dAtA, i, uint64(m.MaxProvidersToPair)) - i-- - dAtA[i] = 0x28 - } - if m.EpochCuLimit != 0 { - i = encodeVarintProject(dAtA, i, uint64(m.EpochCuLimit)) - i-- - dAtA[i] = 0x20 - } - if m.TotalCuLimit != 0 { - i = encodeVarintProject(dAtA, i, uint64(m.TotalCuLimit)) - i-- - dAtA[i] = 0x18 - } - if m.GeolocationProfile != 0 { - i = encodeVarintProject(dAtA, i, uint64(m.GeolocationProfile)) - i-- - dAtA[i] = 0x10 - } - if len(m.ChainPolicies) > 0 { - for iNdEx := len(m.ChainPolicies) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ChainPolicies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProject(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ChainPolicy) 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 *ChainPolicy) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChainPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Apis) > 0 { - for iNdEx := len(m.Apis) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Apis[iNdEx]) - copy(dAtA[i:], m.Apis[iNdEx]) - i = encodeVarintProject(dAtA, i, uint64(len(m.Apis[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintProject(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ProtoDeveloperData) 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 *ProtoDeveloperData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProtoDeveloperData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ProjectID) > 0 { - i -= len(m.ProjectID) - copy(dAtA[i:], m.ProjectID) - i = encodeVarintProject(dAtA, i, uint64(len(m.ProjectID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ProjectData) 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 *ProjectData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProjectData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Policy != nil { - { - size, err := m.Policy.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProject(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if len(m.ProjectKeys) > 0 { - for iNdEx := len(m.ProjectKeys) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ProjectKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProject(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.Enabled { - i-- - if m.Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintProject(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintProject(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintProject(dAtA []byte, offset int, v uint64) int { - offset -= sovProject(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Project) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Index) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - l = len(m.Subscription) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - if m.Enabled { - n += 2 - } - if len(m.ProjectKeys) > 0 { - for _, e := range m.ProjectKeys { - l = e.Size() - n += 1 + l + sovProject(uint64(l)) - } - } - if m.AdminPolicy != nil { - l = m.AdminPolicy.Size() - n += 1 + l + sovProject(uint64(l)) - } - if m.UsedCu != 0 { - n += 1 + sovProject(uint64(m.UsedCu)) - } - if m.SubscriptionPolicy != nil { - l = m.SubscriptionPolicy.Size() - n += 1 + l + sovProject(uint64(l)) - } - if m.Snapshot != 0 { - n += 1 + sovProject(uint64(m.Snapshot)) - } - return n -} - -func (m *ProjectKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - if len(m.Types) > 0 { - l = 0 - for _, e := range m.Types { - l += sovProject(uint64(e)) - } - n += 1 + sovProject(uint64(l)) + l - } - return n -} - -func (m *Policy) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ChainPolicies) > 0 { - for _, e := range m.ChainPolicies { - l = e.Size() - n += 1 + l + sovProject(uint64(l)) - } - } - if m.GeolocationProfile != 0 { - n += 1 + sovProject(uint64(m.GeolocationProfile)) - } - if m.TotalCuLimit != 0 { - n += 1 + sovProject(uint64(m.TotalCuLimit)) - } - if m.EpochCuLimit != 0 { - n += 1 + sovProject(uint64(m.EpochCuLimit)) - } - if m.MaxProvidersToPair != 0 { - n += 1 + sovProject(uint64(m.MaxProvidersToPair)) - } - return n -} - -func (m *ChainPolicy) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - if len(m.Apis) > 0 { - for _, s := range m.Apis { - l = len(s) - n += 1 + l + sovProject(uint64(l)) - } - } - return n -} - -func (m *ProtoDeveloperData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ProjectID) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - return n -} - -func (m *ProjectData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - if m.Enabled { - n += 2 - } - if len(m.ProjectKeys) > 0 { - for _, e := range m.ProjectKeys { - l = e.Size() - n += 1 + l + sovProject(uint64(l)) - } - } - if m.Policy != nil { - l = m.Policy.Size() - n += 1 + l + sovProject(uint64(l)) - } - return n -} - -func sovProject(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozProject(x uint64) (n int) { - return sovProject(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Project) 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 ErrIntOverflowProject - } - 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: Project: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Project: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Index = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subscription", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Subscription = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Enabled = bool(v != 0) - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProjectKeys", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProjectKeys = append(m.ProjectKeys, ProjectKey{}) - if err := m.ProjectKeys[len(m.ProjectKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AdminPolicy", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AdminPolicy == nil { - m.AdminPolicy = &Policy{} - } - if err := m.AdminPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UsedCu", wireType) - } - m.UsedCu = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.UsedCu |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SubscriptionPolicy", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SubscriptionPolicy == nil { - m.SubscriptionPolicy = &Policy{} - } - if err := m.SubscriptionPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Snapshot", wireType) - } - m.Snapshot = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Snapshot |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipProject(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProject - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProjectKey) 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 ErrIntOverflowProject - } - 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: ProjectKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProjectKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType == 0 { - var v ProjectKey_KEY_TYPE - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= ProjectKey_KEY_TYPE(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Types = append(m.Types, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - if elementCount != 0 && len(m.Types) == 0 { - m.Types = make([]ProjectKey_KEY_TYPE, 0, elementCount) - } - for iNdEx < postIndex { - var v ProjectKey_KEY_TYPE - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= ProjectKey_KEY_TYPE(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Types = append(m.Types, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Types", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipProject(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProject - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Policy) 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 ErrIntOverflowProject - } - 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: Policy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Policy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainPolicies", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainPolicies = append(m.ChainPolicies, ChainPolicy{}) - if err := m.ChainPolicies[len(m.ChainPolicies)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GeolocationProfile", wireType) - } - m.GeolocationProfile = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GeolocationProfile |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalCuLimit", wireType) - } - m.TotalCuLimit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalCuLimit |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochCuLimit", wireType) - } - m.EpochCuLimit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EpochCuLimit |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxProvidersToPair", wireType) - } - m.MaxProvidersToPair = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxProvidersToPair |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipProject(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProject - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ChainPolicy) 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 ErrIntOverflowProject - } - 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: ChainPolicy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChainPolicy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Apis", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Apis = append(m.Apis, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProject(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProject - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProtoDeveloperData) 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 ErrIntOverflowProject - } - 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: ProtoDeveloperData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProtoDeveloperData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProjectID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProjectID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProject(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProject - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProjectData) 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 ErrIntOverflowProject - } - 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: ProjectData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProjectData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Enabled = bool(v != 0) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProjectKeys", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProjectKeys = append(m.ProjectKeys, ProjectKey{}) - if err := m.ProjectKeys[len(m.ProjectKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Policy", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Policy == nil { - m.Policy = &Policy{} - } - if err := m.Policy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProject(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProject - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipProject(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProject - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProject - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProject - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthProject - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupProject - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthProject - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthProject = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowProject = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupProject = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/projects/migrations/v4/project.pb.go b/x/projects/migrations/v4/project.pb.go deleted file mode 100644 index f1c0d4cdba..0000000000 --- a/x/projects/migrations/v4/project.pb.go +++ /dev/null @@ -1,2375 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: projects/project.proto - -package types - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type ProjectKey_KEY_TYPE int32 - -const ( - ProjectKey_NONE ProjectKey_KEY_TYPE = 0 - ProjectKey_ADMIN ProjectKey_KEY_TYPE = 1 - ProjectKey_DEVELOPER ProjectKey_KEY_TYPE = 2 -) - -var ProjectKey_KEY_TYPE_name = map[int32]string{ - 0: "NONE", - 1: "ADMIN", - 2: "DEVELOPER", -} - -var ProjectKey_KEY_TYPE_value = map[string]int32{ - "NONE": 0, - "ADMIN": 1, - "DEVELOPER": 2, -} - -func (x ProjectKey_KEY_TYPE) String() string { - return proto.EnumName(ProjectKey_KEY_TYPE_name, int32(x)) -} - -func (ProjectKey_KEY_TYPE) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{1, 0} -} - -type Project struct { - Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` - Subscription string `protobuf:"bytes,2,opt,name=subscription,proto3" json:"subscription,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"` - ProjectKeys []ProjectKey `protobuf:"bytes,5,rep,name=project_keys,json=projectKeys,proto3" json:"project_keys"` - AdminPolicy *Policy `protobuf:"bytes,6,opt,name=admin_policy,json=adminPolicy,proto3" json:"admin_policy,omitempty"` - UsedCu uint64 `protobuf:"varint,7,opt,name=used_cu,json=usedCu,proto3" json:"used_cu,omitempty"` - SubscriptionPolicy *Policy `protobuf:"bytes,8,opt,name=subscription_policy,json=subscriptionPolicy,proto3" json:"subscription_policy,omitempty"` - Snapshot uint64 `protobuf:"varint,9,opt,name=snapshot,proto3" json:"snapshot,omitempty"` -} - -func (m *Project) Reset() { *m = Project{} } -func (m *Project) String() string { return proto.CompactTextString(m) } -func (*Project) ProtoMessage() {} -func (*Project) Descriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{0} -} -func (m *Project) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Project) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Project.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 *Project) XXX_Merge(src proto.Message) { - xxx_messageInfo_Project.Merge(m, src) -} -func (m *Project) XXX_Size() int { - return m.Size() -} -func (m *Project) XXX_DiscardUnknown() { - xxx_messageInfo_Project.DiscardUnknown(m) -} - -var xxx_messageInfo_Project proto.InternalMessageInfo - -func (m *Project) GetIndex() string { - if m != nil { - return m.Index - } - return "" -} - -func (m *Project) GetSubscription() string { - if m != nil { - return m.Subscription - } - return "" -} - -func (m *Project) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *Project) GetEnabled() bool { - if m != nil { - return m.Enabled - } - return false -} - -func (m *Project) GetProjectKeys() []ProjectKey { - if m != nil { - return m.ProjectKeys - } - return nil -} - -func (m *Project) GetAdminPolicy() *Policy { - if m != nil { - return m.AdminPolicy - } - return nil -} - -func (m *Project) GetUsedCu() uint64 { - if m != nil { - return m.UsedCu - } - return 0 -} - -func (m *Project) GetSubscriptionPolicy() *Policy { - if m != nil { - return m.SubscriptionPolicy - } - return nil -} - -func (m *Project) GetSnapshot() uint64 { - if m != nil { - return m.Snapshot - } - return 0 -} - -type ProjectKey struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Types []ProjectKey_KEY_TYPE `protobuf:"varint,2,rep,packed,name=types,proto3,enum=lavanet.lava.projects.ProjectKey_KEY_TYPE" json:"types,omitempty"` -} - -func (m *ProjectKey) Reset() { *m = ProjectKey{} } -func (m *ProjectKey) String() string { return proto.CompactTextString(m) } -func (*ProjectKey) ProtoMessage() {} -func (*ProjectKey) Descriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{1} -} -func (m *ProjectKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProjectKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProjectKey.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 *ProjectKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProjectKey.Merge(m, src) -} -func (m *ProjectKey) XXX_Size() int { - return m.Size() -} -func (m *ProjectKey) XXX_DiscardUnknown() { - xxx_messageInfo_ProjectKey.DiscardUnknown(m) -} - -var xxx_messageInfo_ProjectKey proto.InternalMessageInfo - -func (m *ProjectKey) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *ProjectKey) GetTypes() []ProjectKey_KEY_TYPE { - if m != nil { - return m.Types - } - return nil -} - -// protobuf expected in YAML format: used "moretags" to simplify parsing -type Policy struct { - ChainPolicies []ChainPolicy `protobuf:"bytes,1,rep,name=chain_policies,json=chainPolicies,proto3" json:"chain_policies" mapstructure:"chain_policies"` - GeolocationProfile uint64 `protobuf:"varint,2,opt,name=geolocation_profile,json=geolocationProfile,proto3" json:"geolocation_profile" mapstructure:"geolocation_profile"` - TotalCuLimit uint64 `protobuf:"varint,3,opt,name=total_cu_limit,json=totalCuLimit,proto3" json:"total_cu_limit" mapstructure:"total_cu_limit"` - EpochCuLimit uint64 `protobuf:"varint,4,opt,name=epoch_cu_limit,json=epochCuLimit,proto3" json:"epoch_cu_limit" mapstructure:"epoch_cu_limit"` - MaxProvidersToPair uint64 `protobuf:"varint,5,opt,name=max_providers_to_pair,json=maxProvidersToPair,proto3" json:"max_providers_to_pair" mapstructure:"max_providers_to_pair"` -} - -func (m *Policy) Reset() { *m = Policy{} } -func (m *Policy) String() string { return proto.CompactTextString(m) } -func (*Policy) ProtoMessage() {} -func (*Policy) Descriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{2} -} -func (m *Policy) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Policy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Policy.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 *Policy) XXX_Merge(src proto.Message) { - xxx_messageInfo_Policy.Merge(m, src) -} -func (m *Policy) XXX_Size() int { - return m.Size() -} -func (m *Policy) XXX_DiscardUnknown() { - xxx_messageInfo_Policy.DiscardUnknown(m) -} - -var xxx_messageInfo_Policy proto.InternalMessageInfo - -func (m *Policy) GetChainPolicies() []ChainPolicy { - if m != nil { - return m.ChainPolicies - } - return nil -} - -func (m *Policy) GetGeolocationProfile() uint64 { - if m != nil { - return m.GeolocationProfile - } - return 0 -} - -func (m *Policy) GetTotalCuLimit() uint64 { - if m != nil { - return m.TotalCuLimit - } - return 0 -} - -func (m *Policy) GetEpochCuLimit() uint64 { - if m != nil { - return m.EpochCuLimit - } - return 0 -} - -func (m *Policy) GetMaxProvidersToPair() uint64 { - if m != nil { - return m.MaxProvidersToPair - } - return 0 -} - -type ChainPolicy struct { - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty" mapstructure:"chain_id"` - Apis []string `protobuf:"bytes,2,rep,name=apis,proto3" json:"apis,omitempty" mapstructure:"apis"` -} - -func (m *ChainPolicy) Reset() { *m = ChainPolicy{} } -func (m *ChainPolicy) String() string { return proto.CompactTextString(m) } -func (*ChainPolicy) ProtoMessage() {} -func (*ChainPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{3} -} -func (m *ChainPolicy) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ChainPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChainPolicy.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 *ChainPolicy) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChainPolicy.Merge(m, src) -} -func (m *ChainPolicy) XXX_Size() int { - return m.Size() -} -func (m *ChainPolicy) XXX_DiscardUnknown() { - xxx_messageInfo_ChainPolicy.DiscardUnknown(m) -} - -var xxx_messageInfo_ChainPolicy proto.InternalMessageInfo - -func (m *ChainPolicy) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - -func (m *ChainPolicy) GetApis() []string { - if m != nil { - return m.Apis - } - return nil -} - -type ProtoDeveloperData struct { - ProjectID string `protobuf:"bytes,1,opt,name=projectID,proto3" json:"projectID,omitempty"` -} - -func (m *ProtoDeveloperData) Reset() { *m = ProtoDeveloperData{} } -func (m *ProtoDeveloperData) String() string { return proto.CompactTextString(m) } -func (*ProtoDeveloperData) ProtoMessage() {} -func (*ProtoDeveloperData) Descriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{4} -} -func (m *ProtoDeveloperData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProtoDeveloperData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProtoDeveloperData.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 *ProtoDeveloperData) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProtoDeveloperData.Merge(m, src) -} -func (m *ProtoDeveloperData) XXX_Size() int { - return m.Size() -} -func (m *ProtoDeveloperData) XXX_DiscardUnknown() { - xxx_messageInfo_ProtoDeveloperData.DiscardUnknown(m) -} - -var xxx_messageInfo_ProtoDeveloperData proto.InternalMessageInfo - -func (m *ProtoDeveloperData) GetProjectID() string { - if m != nil { - return m.ProjectID - } - return "" -} - -// used as a container struct for the subscription module -type ProjectData struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Enabled bool `protobuf:"varint,3,opt,name=enabled,proto3" json:"enabled,omitempty"` - ProjectKeys []ProjectKey `protobuf:"bytes,4,rep,name=projectKeys,proto3" json:"projectKeys"` - Policy *Policy `protobuf:"bytes,5,opt,name=policy,proto3" json:"policy,omitempty"` -} - -func (m *ProjectData) Reset() { *m = ProjectData{} } -func (m *ProjectData) String() string { return proto.CompactTextString(m) } -func (*ProjectData) ProtoMessage() {} -func (*ProjectData) Descriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{5} -} -func (m *ProjectData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProjectData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProjectData.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 *ProjectData) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProjectData.Merge(m, src) -} -func (m *ProjectData) XXX_Size() int { - return m.Size() -} -func (m *ProjectData) XXX_DiscardUnknown() { - xxx_messageInfo_ProjectData.DiscardUnknown(m) -} - -var xxx_messageInfo_ProjectData proto.InternalMessageInfo - -func (m *ProjectData) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *ProjectData) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *ProjectData) GetEnabled() bool { - if m != nil { - return m.Enabled - } - return false -} - -func (m *ProjectData) GetProjectKeys() []ProjectKey { - if m != nil { - return m.ProjectKeys - } - return nil -} - -func (m *ProjectData) GetPolicy() *Policy { - if m != nil { - return m.Policy - } - return nil -} - -func init() { - proto.RegisterEnum("lavanet.lava.projects.ProjectKey_KEY_TYPE_V4", ProjectKey_KEY_TYPE_name, ProjectKey_KEY_TYPE_value) - proto.RegisterType((*Project)(nil), "lavanet.lava.projects.Project_V4") - proto.RegisterType((*ProjectKey)(nil), "lavanet.lava.projects.ProjectKey_V4") - proto.RegisterType((*Policy)(nil), "lavanet.lava.projects.Policy_V4") - proto.RegisterType((*ChainPolicy)(nil), "lavanet.lava.projects.ChainPolicy_V4") - proto.RegisterType((*ProtoDeveloperData)(nil), "lavanet.lava.projects.ProtoDeveloperData_V4") - proto.RegisterType((*ProjectData)(nil), "lavanet.lava.projects.ProjectData_V4") -} - -func init() { proto.RegisterFile("projects/project.proto", fileDescriptor_9f89a31663a330ce) } - -var fileDescriptor_9f89a31663a330ce = []byte{ - // 777 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4f, 0xab, 0xdb, 0x46, - 0x10, 0xb7, 0x2c, 0xd9, 0x96, 0xc7, 0xce, 0xc3, 0xec, 0x4b, 0x1a, 0x91, 0x34, 0x96, 0xbb, 0xb4, - 0x60, 0x7a, 0x90, 0xe1, 0x85, 0x96, 0x52, 0x28, 0x34, 0x7e, 0x76, 0xc0, 0x2f, 0xa9, 0x63, 0x44, - 0x28, 0xbc, 0x5e, 0xc4, 0x5a, 0xda, 0xda, 0xdb, 0xc8, 0x5a, 0xa1, 0x3f, 0xc6, 0xfe, 0x16, 0xa5, - 0x87, 0x9e, 0xfa, 0x01, 0xfa, 0x51, 0x72, 0xcc, 0xb1, 0x27, 0xb5, 0xf8, 0xdd, 0xde, 0xd1, 0x9f, - 0xa0, 0x68, 0x25, 0xff, 0x51, 0xe2, 0xb4, 0x81, 0x9c, 0x34, 0xf3, 0x9b, 0xdf, 0xcc, 0xec, 0xec, - 0x8c, 0x66, 0xe1, 0x13, 0x3f, 0xe0, 0xbf, 0x50, 0x3b, 0x0a, 0x7b, 0xb9, 0x60, 0xf8, 0x01, 0x8f, - 0x38, 0xba, 0xe7, 0x92, 0x25, 0xf1, 0x68, 0x64, 0xa4, 0x5f, 0x63, 0x47, 0x7a, 0x70, 0x77, 0xc6, - 0x67, 0x5c, 0x30, 0x7a, 0xa9, 0x94, 0x91, 0xf1, 0x6f, 0x32, 0xd4, 0x26, 0x19, 0x05, 0xdd, 0x85, - 0x0a, 0xf3, 0x1c, 0xba, 0xd2, 0xa4, 0x8e, 0xd4, 0xad, 0x9b, 0x99, 0x82, 0x30, 0x34, 0xc3, 0x78, - 0x1a, 0xda, 0x01, 0xf3, 0x23, 0xc6, 0x3d, 0xad, 0x2c, 0x8c, 0x05, 0x0c, 0x75, 0xa0, 0xe1, 0xd0, - 0x03, 0x45, 0x16, 0x94, 0x63, 0x08, 0x69, 0x50, 0xa3, 0x1e, 0x99, 0xba, 0xd4, 0xd1, 0x94, 0x8e, - 0xd4, 0x55, 0xcd, 0x9d, 0x8a, 0xae, 0xa0, 0x99, 0x9f, 0xd1, 0x7a, 0x45, 0xd7, 0xa1, 0x56, 0xe9, - 0xc8, 0xdd, 0xc6, 0xc5, 0x67, 0xc6, 0xc9, 0x2a, 0x8c, 0xfc, 0xac, 0xcf, 0xe8, 0xba, 0xaf, 0xbc, - 0x4e, 0xf4, 0x92, 0xd9, 0xf0, 0xf7, 0x48, 0x88, 0xbe, 0x87, 0x26, 0x71, 0x16, 0xcc, 0xb3, 0x7c, - 0xee, 0x32, 0x7b, 0xad, 0x55, 0x3b, 0x52, 0xb7, 0x71, 0xf1, 0xe8, 0x7d, 0xb1, 0x04, 0xc9, 0x6c, - 0x08, 0x97, 0x4c, 0x41, 0xf7, 0xa1, 0x16, 0x87, 0xd4, 0xb1, 0xec, 0x58, 0xab, 0x75, 0xa4, 0xae, - 0x62, 0x56, 0x53, 0xf5, 0x32, 0x46, 0x63, 0x38, 0x3f, 0x2e, 0x79, 0x97, 0x41, 0xfd, 0x90, 0x0c, - 0xe8, 0xd8, 0x33, 0x4f, 0xf4, 0x00, 0xd4, 0xd0, 0x23, 0x7e, 0x38, 0xe7, 0x91, 0x56, 0x17, 0x99, - 0xf6, 0x3a, 0xfe, 0x43, 0x02, 0x38, 0x14, 0x8a, 0x5a, 0x20, 0xbf, 0xa2, 0xeb, 0xbc, 0x2b, 0xa9, - 0x88, 0x9e, 0x42, 0x25, 0x5a, 0xfb, 0x34, 0xd4, 0xca, 0x1d, 0xb9, 0x7b, 0x76, 0xf1, 0xe5, 0xff, - 0x5e, 0x96, 0xf1, 0x6c, 0x78, 0x6d, 0xbd, 0xbc, 0x9e, 0x0c, 0xf3, 0x5b, 0xcb, 0xdc, 0xb1, 0x01, - 0xea, 0xce, 0x80, 0x54, 0x50, 0xc6, 0x2f, 0xc6, 0xc3, 0x56, 0x09, 0xd5, 0xa1, 0xf2, 0x64, 0xf0, - 0xc3, 0x68, 0xdc, 0x92, 0xd0, 0x1d, 0xa8, 0x0f, 0x86, 0x3f, 0x0e, 0x9f, 0xbf, 0x98, 0x0c, 0xcd, - 0x56, 0xf9, 0x4a, 0x51, 0xe5, 0x96, 0x82, 0x7f, 0x57, 0xa0, 0x9a, 0x57, 0xe1, 0xc3, 0x99, 0x3d, - 0x27, 0xbb, 0x0b, 0x67, 0x34, 0xd4, 0x24, 0xd1, 0x3e, 0xfc, 0x9e, 0x13, 0x5d, 0xa6, 0xe4, 0xcc, - 0xb7, 0xff, 0x45, 0x7a, 0x92, 0x6d, 0xa2, 0x3f, 0x5a, 0x10, 0x3f, 0x8c, 0x82, 0xd8, 0x8e, 0xe2, - 0x80, 0x7e, 0x8b, 0x8b, 0xf1, 0xb0, 0x79, 0xc7, 0xde, 0xfb, 0x30, 0x1a, 0x22, 0x0f, 0xce, 0x67, - 0x94, 0xbb, 0xdc, 0x26, 0x59, 0x1b, 0x02, 0xfe, 0x33, 0x73, 0xa9, 0x98, 0x4a, 0xa5, 0xff, 0xdd, - 0x6d, 0xa2, 0x9f, 0x32, 0x6f, 0x13, 0x1d, 0x17, 0xb3, 0x9c, 0x20, 0x61, 0x13, 0x1d, 0xa1, 0x93, - 0x0c, 0x44, 0xd7, 0x70, 0x16, 0xf1, 0x88, 0xb8, 0x96, 0x1d, 0x5b, 0x2e, 0x5b, 0xb0, 0x48, 0x4c, - 0xb7, 0xd2, 0x7f, 0x7c, 0x9b, 0xe8, 0x6f, 0x59, 0xde, 0xad, 0xa5, 0x68, 0xc7, 0x66, 0x53, 0x00, - 0x97, 0xf1, 0xf3, 0x54, 0x4d, 0x43, 0x53, 0x9f, 0xdb, 0xf3, 0x43, 0x68, 0xe5, 0x10, 0xba, 0x68, - 0x79, 0x37, 0x74, 0xd1, 0x8e, 0xcd, 0xa6, 0x00, 0x76, 0xa1, 0x23, 0xb8, 0xb7, 0x20, 0xab, 0xb4, - 0xb2, 0x25, 0x73, 0x68, 0x10, 0x5a, 0x11, 0xb7, 0x7c, 0xc2, 0x02, 0xad, 0x22, 0x32, 0x3c, 0xb9, - 0x4d, 0xf4, 0xd3, 0x84, 0x6d, 0xa2, 0x7f, 0x5e, 0x4c, 0x74, 0x92, 0x86, 0x4d, 0xb4, 0x20, 0xab, - 0xc9, 0x0e, 0x7e, 0xc9, 0x27, 0x29, 0xb8, 0x84, 0xc6, 0x51, 0x83, 0xd1, 0xd7, 0xa0, 0x66, 0xcd, - 0x64, 0x4e, 0x36, 0xbc, 0xfd, 0x87, 0xdb, 0x44, 0xbf, 0x7f, 0xaa, 0xdd, 0xcc, 0xc1, 0x66, 0x4d, - 0x88, 0x23, 0x07, 0xf5, 0x40, 0x21, 0x3e, 0xcb, 0x86, 0xbb, 0xde, 0x7f, 0x98, 0x8f, 0xc9, 0x79, - 0xd1, 0x2f, 0x65, 0x60, 0x53, 0x10, 0xf1, 0x37, 0x80, 0x26, 0xe9, 0x36, 0x1b, 0xd0, 0x25, 0x75, - 0xb9, 0x4f, 0x83, 0x01, 0x89, 0x08, 0xfa, 0x14, 0xea, 0xf9, 0xdc, 0x8d, 0x06, 0xf9, 0xcf, 0x73, - 0x00, 0xae, 0x14, 0xb5, 0xdc, 0x92, 0xf1, 0xdf, 0x12, 0x34, 0xf2, 0xbf, 0x44, 0xf8, 0x20, 0x50, - 0x3c, 0xb2, 0xa0, 0x39, 0x5d, 0xc8, 0x6f, 0x2f, 0xb7, 0xf2, 0x7f, 0x2e, 0x37, 0xb9, 0xb8, 0xdc, - 0x46, 0x70, 0xbc, 0x9f, 0x34, 0xe5, 0x23, 0x76, 0xdb, 0x57, 0x50, 0xcd, 0x77, 0x4e, 0xe5, 0x43, - 0x76, 0x4e, 0x4e, 0xee, 0x3f, 0xfd, 0x73, 0xd3, 0x96, 0x5e, 0x6f, 0xda, 0xd2, 0x9b, 0x4d, 0x5b, - 0xfa, 0x67, 0xd3, 0x96, 0x7e, 0xbd, 0x69, 0x97, 0xde, 0xdc, 0xb4, 0x4b, 0x7f, 0xdd, 0xb4, 0x4b, - 0x3f, 0x75, 0x67, 0x2c, 0x9a, 0xc7, 0x53, 0xc3, 0xe6, 0x8b, 0x5e, 0x1e, 0x4e, 0x7c, 0x7b, 0xab, - 0xde, 0xfe, 0x75, 0x11, 0xab, 0x62, 0x5a, 0x15, 0xef, 0xc5, 0xe3, 0x7f, 0x03, 0x00, 0x00, 0xff, - 0xff, 0xc4, 0x11, 0xe0, 0xc1, 0x76, 0x06, 0x00, 0x00, -} - -func (this *Project) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Project) - if !ok { - that2, ok := that.(Project) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Index != that1.Index { - return false - } - if this.Subscription != that1.Subscription { - return false - } - if this.Description != that1.Description { - return false - } - if this.Enabled != that1.Enabled { - return false - } - if len(this.ProjectKeys) != len(that1.ProjectKeys) { - return false - } - for i := range this.ProjectKeys { - if !this.ProjectKeys[i].Equal(&that1.ProjectKeys[i]) { - return false - } - } - if !this.AdminPolicy.Equal(that1.AdminPolicy) { - return false - } - if this.UsedCu != that1.UsedCu { - return false - } - if !this.SubscriptionPolicy.Equal(that1.SubscriptionPolicy) { - return false - } - if this.Snapshot != that1.Snapshot { - return false - } - return true -} -func (this *ProjectKey) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ProjectKey) - if !ok { - that2, ok := that.(ProjectKey) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Key != that1.Key { - return false - } - if len(this.Types) != len(that1.Types) { - return false - } - for i := range this.Types { - if this.Types[i] != that1.Types[i] { - return false - } - } - return true -} -func (this *Policy) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Policy) - if !ok { - that2, ok := that.(Policy) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.ChainPolicies) != len(that1.ChainPolicies) { - return false - } - for i := range this.ChainPolicies { - if !this.ChainPolicies[i].Equal(&that1.ChainPolicies[i]) { - return false - } - } - if this.GeolocationProfile != that1.GeolocationProfile { - return false - } - if this.TotalCuLimit != that1.TotalCuLimit { - return false - } - if this.EpochCuLimit != that1.EpochCuLimit { - return false - } - if this.MaxProvidersToPair != that1.MaxProvidersToPair { - return false - } - return true -} -func (this *ChainPolicy) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ChainPolicy) - if !ok { - that2, ok := that.(ChainPolicy) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ChainId != that1.ChainId { - return false - } - if len(this.Apis) != len(that1.Apis) { - return false - } - for i := range this.Apis { - if this.Apis[i] != that1.Apis[i] { - return false - } - } - return true -} -func (this *ProtoDeveloperData) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ProtoDeveloperData) - if !ok { - that2, ok := that.(ProtoDeveloperData) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ProjectID != that1.ProjectID { - return false - } - return true -} -func (this *ProjectData) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ProjectData) - if !ok { - that2, ok := that.(ProjectData) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if this.Description != that1.Description { - return false - } - if this.Enabled != that1.Enabled { - return false - } - if len(this.ProjectKeys) != len(that1.ProjectKeys) { - return false - } - for i := range this.ProjectKeys { - if !this.ProjectKeys[i].Equal(&that1.ProjectKeys[i]) { - return false - } - } - if !this.Policy.Equal(that1.Policy) { - return false - } - return true -} -func (m *Project) 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 *Project) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Project) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Snapshot != 0 { - i = encodeVarintProject(dAtA, i, uint64(m.Snapshot)) - i-- - dAtA[i] = 0x48 - } - if m.SubscriptionPolicy != nil { - { - size, err := m.SubscriptionPolicy.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProject(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if m.UsedCu != 0 { - i = encodeVarintProject(dAtA, i, uint64(m.UsedCu)) - i-- - dAtA[i] = 0x38 - } - if m.AdminPolicy != nil { - { - size, err := m.AdminPolicy.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProject(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if len(m.ProjectKeys) > 0 { - for iNdEx := len(m.ProjectKeys) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ProjectKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProject(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if m.Enabled { - i-- - if m.Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintProject(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x1a - } - if len(m.Subscription) > 0 { - i -= len(m.Subscription) - copy(dAtA[i:], m.Subscription) - i = encodeVarintProject(dAtA, i, uint64(len(m.Subscription))) - i-- - dAtA[i] = 0x12 - } - if len(m.Index) > 0 { - i -= len(m.Index) - copy(dAtA[i:], m.Index) - i = encodeVarintProject(dAtA, i, uint64(len(m.Index))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ProjectKey) 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 *ProjectKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProjectKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Types) > 0 { - dAtA4 := make([]byte, len(m.Types)*10) - var j3 int - for _, num := range m.Types { - for num >= 1<<7 { - dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j3++ - } - dAtA4[j3] = uint8(num) - j3++ - } - i -= j3 - copy(dAtA[i:], dAtA4[:j3]) - i = encodeVarintProject(dAtA, i, uint64(j3)) - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintProject(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Policy) 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 *Policy) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Policy) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.MaxProvidersToPair != 0 { - i = encodeVarintProject(dAtA, i, uint64(m.MaxProvidersToPair)) - i-- - dAtA[i] = 0x28 - } - if m.EpochCuLimit != 0 { - i = encodeVarintProject(dAtA, i, uint64(m.EpochCuLimit)) - i-- - dAtA[i] = 0x20 - } - if m.TotalCuLimit != 0 { - i = encodeVarintProject(dAtA, i, uint64(m.TotalCuLimit)) - i-- - dAtA[i] = 0x18 - } - if m.GeolocationProfile != 0 { - i = encodeVarintProject(dAtA, i, uint64(m.GeolocationProfile)) - i-- - dAtA[i] = 0x10 - } - if len(m.ChainPolicies) > 0 { - for iNdEx := len(m.ChainPolicies) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ChainPolicies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProject(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ChainPolicy) 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 *ChainPolicy) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChainPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Apis) > 0 { - for iNdEx := len(m.Apis) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Apis[iNdEx]) - copy(dAtA[i:], m.Apis[iNdEx]) - i = encodeVarintProject(dAtA, i, uint64(len(m.Apis[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintProject(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ProtoDeveloperData) 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 *ProtoDeveloperData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProtoDeveloperData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ProjectID) > 0 { - i -= len(m.ProjectID) - copy(dAtA[i:], m.ProjectID) - i = encodeVarintProject(dAtA, i, uint64(len(m.ProjectID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ProjectData) 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 *ProjectData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProjectData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Policy != nil { - { - size, err := m.Policy.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProject(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if len(m.ProjectKeys) > 0 { - for iNdEx := len(m.ProjectKeys) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ProjectKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProject(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.Enabled { - i-- - if m.Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintProject(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintProject(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintProject(dAtA []byte, offset int, v uint64) int { - offset -= sovProject(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Project) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Index) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - l = len(m.Subscription) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - if m.Enabled { - n += 2 - } - if len(m.ProjectKeys) > 0 { - for _, e := range m.ProjectKeys { - l = e.Size() - n += 1 + l + sovProject(uint64(l)) - } - } - if m.AdminPolicy != nil { - l = m.AdminPolicy.Size() - n += 1 + l + sovProject(uint64(l)) - } - if m.UsedCu != 0 { - n += 1 + sovProject(uint64(m.UsedCu)) - } - if m.SubscriptionPolicy != nil { - l = m.SubscriptionPolicy.Size() - n += 1 + l + sovProject(uint64(l)) - } - if m.Snapshot != 0 { - n += 1 + sovProject(uint64(m.Snapshot)) - } - return n -} - -func (m *ProjectKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - if len(m.Types) > 0 { - l = 0 - for _, e := range m.Types { - l += sovProject(uint64(e)) - } - n += 1 + sovProject(uint64(l)) + l - } - return n -} - -func (m *Policy) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ChainPolicies) > 0 { - for _, e := range m.ChainPolicies { - l = e.Size() - n += 1 + l + sovProject(uint64(l)) - } - } - if m.GeolocationProfile != 0 { - n += 1 + sovProject(uint64(m.GeolocationProfile)) - } - if m.TotalCuLimit != 0 { - n += 1 + sovProject(uint64(m.TotalCuLimit)) - } - if m.EpochCuLimit != 0 { - n += 1 + sovProject(uint64(m.EpochCuLimit)) - } - if m.MaxProvidersToPair != 0 { - n += 1 + sovProject(uint64(m.MaxProvidersToPair)) - } - return n -} - -func (m *ChainPolicy) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - if len(m.Apis) > 0 { - for _, s := range m.Apis { - l = len(s) - n += 1 + l + sovProject(uint64(l)) - } - } - return n -} - -func (m *ProtoDeveloperData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ProjectID) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - return n -} - -func (m *ProjectData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - if m.Enabled { - n += 2 - } - if len(m.ProjectKeys) > 0 { - for _, e := range m.ProjectKeys { - l = e.Size() - n += 1 + l + sovProject(uint64(l)) - } - } - if m.Policy != nil { - l = m.Policy.Size() - n += 1 + l + sovProject(uint64(l)) - } - return n -} - -func sovProject(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozProject(x uint64) (n int) { - return sovProject(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Project) 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 ErrIntOverflowProject - } - 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: Project: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Project: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Index = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subscription", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Subscription = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Enabled = bool(v != 0) - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProjectKeys", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProjectKeys = append(m.ProjectKeys, ProjectKey{}) - if err := m.ProjectKeys[len(m.ProjectKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AdminPolicy", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AdminPolicy == nil { - m.AdminPolicy = &Policy{} - } - if err := m.AdminPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UsedCu", wireType) - } - m.UsedCu = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.UsedCu |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SubscriptionPolicy", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SubscriptionPolicy == nil { - m.SubscriptionPolicy = &Policy{} - } - if err := m.SubscriptionPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Snapshot", wireType) - } - m.Snapshot = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Snapshot |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipProject(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProject - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProjectKey) 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 ErrIntOverflowProject - } - 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: ProjectKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProjectKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType == 0 { - var v ProjectKey_KEY_TYPE - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= ProjectKey_KEY_TYPE(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Types = append(m.Types, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - if elementCount != 0 && len(m.Types) == 0 { - m.Types = make([]ProjectKey_KEY_TYPE, 0, elementCount) - } - for iNdEx < postIndex { - var v ProjectKey_KEY_TYPE - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= ProjectKey_KEY_TYPE(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Types = append(m.Types, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Types", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipProject(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProject - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Policy) 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 ErrIntOverflowProject - } - 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: Policy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Policy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainPolicies", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainPolicies = append(m.ChainPolicies, ChainPolicy{}) - if err := m.ChainPolicies[len(m.ChainPolicies)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GeolocationProfile", wireType) - } - m.GeolocationProfile = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GeolocationProfile |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalCuLimit", wireType) - } - m.TotalCuLimit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalCuLimit |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochCuLimit", wireType) - } - m.EpochCuLimit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EpochCuLimit |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxProvidersToPair", wireType) - } - m.MaxProvidersToPair = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxProvidersToPair |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipProject(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProject - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ChainPolicy) 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 ErrIntOverflowProject - } - 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: ChainPolicy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChainPolicy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Apis", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Apis = append(m.Apis, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProject(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProject - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProtoDeveloperData) 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 ErrIntOverflowProject - } - 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: ProtoDeveloperData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProtoDeveloperData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProjectID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProjectID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProject(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProject - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProjectData) 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 ErrIntOverflowProject - } - 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: ProjectData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProjectData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Enabled = bool(v != 0) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProjectKeys", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProjectKeys = append(m.ProjectKeys, ProjectKey{}) - if err := m.ProjectKeys[len(m.ProjectKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Policy", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Policy == nil { - m.Policy = &Policy{} - } - if err := m.Policy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProject(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProject - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipProject(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProject - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProject - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProject - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthProject - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupProject - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthProject - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthProject = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowProject = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupProject = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/projects/migrations/v5/project.go b/x/projects/migrations/v5/project.go deleted file mode 100644 index f261e17272..0000000000 --- a/x/projects/migrations/v5/project.go +++ /dev/null @@ -1,10 +0,0 @@ -package types - -func NewProjectKey(key string, kinds uint32) ProjectKey { - return ProjectKey{Key: key, Kinds: kinds} -} - -func (projectKey ProjectKey) AddType(kind ProjectKey_Type) ProjectKey { - projectKey.Kinds |= uint32(kind) - return projectKey -} diff --git a/x/projects/migrations/v5/project.pb.go b/x/projects/migrations/v5/project.pb.go deleted file mode 100644 index 92fc162a18..0000000000 --- a/x/projects/migrations/v5/project.pb.go +++ /dev/null @@ -1,2302 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: projects/project.proto - -package types - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type ProjectKey_Type int32 - -const ( - ProjectKey_NONE ProjectKey_Type = 0 - ProjectKey_ADMIN ProjectKey_Type = 1 - ProjectKey_DEVELOPER ProjectKey_Type = 2 -) - -var ProjectKey_Type_name = map[int32]string{ - 0: "NONE", - 1: "ADMIN", - 2: "DEVELOPER", -} - -var ProjectKey_Type_value = map[string]int32{ - "NONE": 0, - "ADMIN": 1, - "DEVELOPER": 2, -} - -func (x ProjectKey_Type) String() string { - return proto.EnumName(ProjectKey_Type_name, int32(x)) -} - -func (ProjectKey_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{1, 0} -} - -type Project struct { - Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` - Subscription string `protobuf:"bytes,2,opt,name=subscription,proto3" json:"subscription,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"` - ProjectKeys []ProjectKey `protobuf:"bytes,5,rep,name=project_keys,json=projectKeys,proto3" json:"project_keys"` - AdminPolicy *Policy `protobuf:"bytes,6,opt,name=admin_policy,json=adminPolicy,proto3" json:"admin_policy,omitempty"` - UsedCu uint64 `protobuf:"varint,7,opt,name=used_cu,json=usedCu,proto3" json:"used_cu,omitempty"` - SubscriptionPolicy *Policy `protobuf:"bytes,8,opt,name=subscription_policy,json=subscriptionPolicy,proto3" json:"subscription_policy,omitempty"` - Snapshot uint64 `protobuf:"varint,9,opt,name=snapshot,proto3" json:"snapshot,omitempty"` -} - -func (m *Project) Reset() { *m = Project{} } -func (m *Project) String() string { return proto.CompactTextString(m) } -func (*Project) ProtoMessage() {} -func (*Project) Descriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{0} -} -func (m *Project) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Project) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Project.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 *Project) XXX_Merge(src proto.Message) { - xxx_messageInfo_Project.Merge(m, src) -} -func (m *Project) XXX_Size() int { - return m.Size() -} -func (m *Project) XXX_DiscardUnknown() { - xxx_messageInfo_Project.DiscardUnknown(m) -} - -var xxx_messageInfo_Project proto.InternalMessageInfo - -func (m *Project) GetIndex() string { - if m != nil { - return m.Index - } - return "" -} - -func (m *Project) GetSubscription() string { - if m != nil { - return m.Subscription - } - return "" -} - -func (m *Project) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *Project) GetEnabled() bool { - if m != nil { - return m.Enabled - } - return false -} - -func (m *Project) GetProjectKeys() []ProjectKey { - if m != nil { - return m.ProjectKeys - } - return nil -} - -func (m *Project) GetAdminPolicy() *Policy { - if m != nil { - return m.AdminPolicy - } - return nil -} - -func (m *Project) GetUsedCu() uint64 { - if m != nil { - return m.UsedCu - } - return 0 -} - -func (m *Project) GetSubscriptionPolicy() *Policy { - if m != nil { - return m.SubscriptionPolicy - } - return nil -} - -func (m *Project) GetSnapshot() uint64 { - if m != nil { - return m.Snapshot - } - return 0 -} - -type ProjectKey struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Kinds uint32 `protobuf:"varint,4,opt,name=kinds,proto3" json:"kinds,omitempty"` -} - -func (m *ProjectKey) Reset() { *m = ProjectKey{} } -func (m *ProjectKey) String() string { return proto.CompactTextString(m) } -func (*ProjectKey) ProtoMessage() {} -func (*ProjectKey) Descriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{1} -} -func (m *ProjectKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProjectKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProjectKey.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 *ProjectKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProjectKey.Merge(m, src) -} -func (m *ProjectKey) XXX_Size() int { - return m.Size() -} -func (m *ProjectKey) XXX_DiscardUnknown() { - xxx_messageInfo_ProjectKey.DiscardUnknown(m) -} - -var xxx_messageInfo_ProjectKey proto.InternalMessageInfo - -func (m *ProjectKey) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *ProjectKey) GetKinds() uint32 { - if m != nil { - return m.Kinds - } - return 0 -} - -// protobuf expected in YAML format: used "moretags" to simplify parsing -type Policy struct { - ChainPolicies []ChainPolicy `protobuf:"bytes,1,rep,name=chain_policies,json=chainPolicies,proto3" json:"chain_policies" mapstructure:"chain_policies"` - GeolocationProfile uint64 `protobuf:"varint,2,opt,name=geolocation_profile,json=geolocationProfile,proto3" json:"geolocation_profile" mapstructure:"geolocation_profile"` - TotalCuLimit uint64 `protobuf:"varint,3,opt,name=total_cu_limit,json=totalCuLimit,proto3" json:"total_cu_limit" mapstructure:"total_cu_limit"` - EpochCuLimit uint64 `protobuf:"varint,4,opt,name=epoch_cu_limit,json=epochCuLimit,proto3" json:"epoch_cu_limit" mapstructure:"epoch_cu_limit"` - MaxProvidersToPair uint64 `protobuf:"varint,5,opt,name=max_providers_to_pair,json=maxProvidersToPair,proto3" json:"max_providers_to_pair" mapstructure:"max_providers_to_pair"` -} - -func (m *Policy) Reset() { *m = Policy{} } -func (m *Policy) String() string { return proto.CompactTextString(m) } -func (*Policy) ProtoMessage() {} -func (*Policy) Descriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{2} -} -func (m *Policy) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Policy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Policy.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 *Policy) XXX_Merge(src proto.Message) { - xxx_messageInfo_Policy.Merge(m, src) -} -func (m *Policy) XXX_Size() int { - return m.Size() -} -func (m *Policy) XXX_DiscardUnknown() { - xxx_messageInfo_Policy.DiscardUnknown(m) -} - -var xxx_messageInfo_Policy proto.InternalMessageInfo - -func (m *Policy) GetChainPolicies() []ChainPolicy { - if m != nil { - return m.ChainPolicies - } - return nil -} - -func (m *Policy) GetGeolocationProfile() uint64 { - if m != nil { - return m.GeolocationProfile - } - return 0 -} - -func (m *Policy) GetTotalCuLimit() uint64 { - if m != nil { - return m.TotalCuLimit - } - return 0 -} - -func (m *Policy) GetEpochCuLimit() uint64 { - if m != nil { - return m.EpochCuLimit - } - return 0 -} - -func (m *Policy) GetMaxProvidersToPair() uint64 { - if m != nil { - return m.MaxProvidersToPair - } - return 0 -} - -type ChainPolicy struct { - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty" mapstructure:"chain_id"` - Apis []string `protobuf:"bytes,2,rep,name=apis,proto3" json:"apis,omitempty" mapstructure:"apis"` -} - -func (m *ChainPolicy) Reset() { *m = ChainPolicy{} } -func (m *ChainPolicy) String() string { return proto.CompactTextString(m) } -func (*ChainPolicy) ProtoMessage() {} -func (*ChainPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{3} -} -func (m *ChainPolicy) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ChainPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChainPolicy.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 *ChainPolicy) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChainPolicy.Merge(m, src) -} -func (m *ChainPolicy) XXX_Size() int { - return m.Size() -} -func (m *ChainPolicy) XXX_DiscardUnknown() { - xxx_messageInfo_ChainPolicy.DiscardUnknown(m) -} - -var xxx_messageInfo_ChainPolicy proto.InternalMessageInfo - -func (m *ChainPolicy) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - -func (m *ChainPolicy) GetApis() []string { - if m != nil { - return m.Apis - } - return nil -} - -type ProtoDeveloperData struct { - ProjectID string `protobuf:"bytes,1,opt,name=projectID,proto3" json:"projectID,omitempty"` -} - -func (m *ProtoDeveloperData) Reset() { *m = ProtoDeveloperData{} } -func (m *ProtoDeveloperData) String() string { return proto.CompactTextString(m) } -func (*ProtoDeveloperData) ProtoMessage() {} -func (*ProtoDeveloperData) Descriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{4} -} -func (m *ProtoDeveloperData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProtoDeveloperData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProtoDeveloperData.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 *ProtoDeveloperData) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProtoDeveloperData.Merge(m, src) -} -func (m *ProtoDeveloperData) XXX_Size() int { - return m.Size() -} -func (m *ProtoDeveloperData) XXX_DiscardUnknown() { - xxx_messageInfo_ProtoDeveloperData.DiscardUnknown(m) -} - -var xxx_messageInfo_ProtoDeveloperData proto.InternalMessageInfo - -func (m *ProtoDeveloperData) GetProjectID() string { - if m != nil { - return m.ProjectID - } - return "" -} - -// used as a container struct for the subscription module -type ProjectData struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Enabled bool `protobuf:"varint,3,opt,name=enabled,proto3" json:"enabled,omitempty"` - ProjectKeys []ProjectKey `protobuf:"bytes,4,rep,name=projectKeys,proto3" json:"projectKeys"` - Policy *Policy `protobuf:"bytes,5,opt,name=policy,proto3" json:"policy,omitempty"` -} - -func (m *ProjectData) Reset() { *m = ProjectData{} } -func (m *ProjectData) String() string { return proto.CompactTextString(m) } -func (*ProjectData) ProtoMessage() {} -func (*ProjectData) Descriptor() ([]byte, []int) { - return fileDescriptor_9f89a31663a330ce, []int{5} -} -func (m *ProjectData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProjectData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProjectData.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 *ProjectData) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProjectData.Merge(m, src) -} -func (m *ProjectData) XXX_Size() int { - return m.Size() -} -func (m *ProjectData) XXX_DiscardUnknown() { - xxx_messageInfo_ProjectData.DiscardUnknown(m) -} - -var xxx_messageInfo_ProjectData proto.InternalMessageInfo - -func (m *ProjectData) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *ProjectData) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *ProjectData) GetEnabled() bool { - if m != nil { - return m.Enabled - } - return false -} - -func (m *ProjectData) GetProjectKeys() []ProjectKey { - if m != nil { - return m.ProjectKeys - } - return nil -} - -func (m *ProjectData) GetPolicy() *Policy { - if m != nil { - return m.Policy - } - return nil -} - -func init() { - proto.RegisterEnum("lavanet.lava.projects.ProjectKey_Type_V5", ProjectKey_Type_name, ProjectKey_Type_value) - proto.RegisterType((*Project)(nil), "lavanet.lava.projects.Project_V5") - proto.RegisterType((*ProjectKey)(nil), "lavanet.lava.projects.ProjectKey_V5") - proto.RegisterType((*Policy)(nil), "lavanet.lava.projects.Policy_V5") - proto.RegisterType((*ChainPolicy)(nil), "lavanet.lava.projects.ChainPolicy_V5") - proto.RegisterType((*ProtoDeveloperData)(nil), "lavanet.lava.projects.ProtoDeveloperData_V5") - proto.RegisterType((*ProjectData)(nil), "lavanet.lava.projects.ProjectData_V5") -} - -func init() { proto.RegisterFile("projects/project.proto", fileDescriptor_9f89a31663a330ce) } - -var fileDescriptor_9f89a31663a330ce = []byte{ - // 760 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4d, 0x6b, 0xf3, 0x46, - 0x10, 0xb6, 0x2c, 0xf9, 0x6b, 0xec, 0xbc, 0x98, 0xcd, 0x9b, 0x46, 0xa4, 0x8d, 0xe5, 0x2e, 0x2d, - 0x98, 0x1e, 0x6c, 0x48, 0x68, 0x29, 0x85, 0x42, 0xe3, 0xd8, 0x05, 0xa7, 0xa9, 0x63, 0x44, 0x28, - 0xb4, 0x17, 0xb3, 0x96, 0xb6, 0xf6, 0x36, 0xb2, 0x56, 0xe8, 0xc3, 0xd8, 0xff, 0xa2, 0xf4, 0xd0, - 0xdf, 0xd0, 0x9f, 0x92, 0x63, 0x8e, 0x3d, 0xa9, 0xc5, 0xb9, 0xe5, 0xe8, 0x5f, 0x50, 0xb4, 0x92, - 0x3f, 0x94, 0x38, 0x25, 0xf0, 0x9e, 0x34, 0xf3, 0xcc, 0x33, 0x33, 0x3b, 0x3b, 0xb3, 0x23, 0xf8, - 0xc8, 0x71, 0xf9, 0x6f, 0xd4, 0xf0, 0xbd, 0x56, 0x22, 0x34, 0x1d, 0x97, 0xfb, 0x1c, 0x1d, 0x59, - 0x64, 0x46, 0x6c, 0xea, 0x37, 0xa3, 0x6f, 0x73, 0x4d, 0x3a, 0x79, 0x3f, 0xe6, 0x63, 0x2e, 0x18, - 0xad, 0x48, 0x8a, 0xc9, 0xf8, 0x0f, 0x19, 0x0a, 0x83, 0x98, 0x82, 0xde, 0x43, 0x8e, 0xd9, 0x26, - 0x9d, 0xab, 0x52, 0x5d, 0x6a, 0x94, 0xf4, 0x58, 0x41, 0x18, 0x2a, 0x5e, 0x30, 0xf2, 0x0c, 0x97, - 0x39, 0x3e, 0xe3, 0xb6, 0x9a, 0x15, 0xc6, 0x14, 0x86, 0xea, 0x50, 0x36, 0xe9, 0x96, 0x22, 0x0b, - 0xca, 0x2e, 0x84, 0x54, 0x28, 0x50, 0x9b, 0x8c, 0x2c, 0x6a, 0xaa, 0x4a, 0x5d, 0x6a, 0x14, 0xf5, - 0xb5, 0x8a, 0xae, 0xa0, 0x92, 0x9c, 0x71, 0x78, 0x47, 0x17, 0x9e, 0x9a, 0xab, 0xcb, 0x8d, 0xf2, - 0xd9, 0xa7, 0xcd, 0xbd, 0x55, 0x34, 0x93, 0xb3, 0xfe, 0x40, 0x17, 0x6d, 0xe5, 0x3e, 0xd4, 0x32, - 0x7a, 0xd9, 0xd9, 0x20, 0x1e, 0xfa, 0x0e, 0x2a, 0xc4, 0x9c, 0x32, 0x7b, 0xe8, 0x70, 0x8b, 0x19, - 0x0b, 0x35, 0x5f, 0x97, 0x1a, 0xe5, 0xb3, 0xd3, 0xd7, 0x62, 0x09, 0x92, 0x5e, 0x16, 0x2e, 0xb1, - 0x82, 0x8e, 0xa1, 0x10, 0x78, 0xd4, 0x1c, 0x1a, 0x81, 0x5a, 0xa8, 0x4b, 0x0d, 0x45, 0xcf, 0x47, - 0xea, 0x65, 0x80, 0xfa, 0x70, 0xb8, 0x5b, 0xf2, 0x3a, 0x43, 0xf1, 0x2d, 0x19, 0xd0, 0xae, 0x67, - 0x92, 0xe8, 0x04, 0x8a, 0x9e, 0x4d, 0x1c, 0x6f, 0xc2, 0x7d, 0xb5, 0x24, 0x32, 0x6d, 0x74, 0x6c, - 0x01, 0x6c, 0xeb, 0x44, 0x55, 0x90, 0xef, 0xe8, 0x22, 0x69, 0x4a, 0x24, 0x46, 0x8d, 0xba, 0x63, - 0xb6, 0xe9, 0x89, 0xab, 0x3c, 0xd0, 0x63, 0x05, 0x7f, 0x01, 0xca, 0xed, 0xc2, 0xa1, 0xa8, 0x08, - 0x4a, 0xff, 0xa6, 0xdf, 0xad, 0x66, 0x50, 0x09, 0x72, 0x17, 0x9d, 0x1f, 0x7b, 0xfd, 0xaa, 0x84, - 0x0e, 0xa0, 0xd4, 0xe9, 0xfe, 0xd4, 0xbd, 0xbe, 0x19, 0x74, 0xf5, 0x6a, 0xf6, 0x4a, 0x29, 0x66, - 0xab, 0xf2, 0x95, 0x52, 0x94, 0xab, 0x0a, 0xfe, 0x53, 0x81, 0x7c, 0x72, 0x28, 0x07, 0xde, 0x19, - 0x13, 0xb2, 0xbe, 0x3f, 0x46, 0x3d, 0x55, 0x12, 0xdd, 0xc0, 0xaf, 0xd4, 0x77, 0x19, 0x91, 0x63, - 0xdf, 0xf6, 0xe7, 0x51, 0x3b, 0x56, 0xa1, 0x76, 0x3a, 0x25, 0x8e, 0xe7, 0xbb, 0x81, 0xe1, 0x07, - 0x2e, 0xfd, 0x06, 0xa7, 0xe3, 0x61, 0xfd, 0xc0, 0xd8, 0xf8, 0x30, 0xea, 0x21, 0x1b, 0x0e, 0xc7, - 0x94, 0x5b, 0xdc, 0x20, 0xf1, 0xad, 0xba, 0xfc, 0x57, 0x66, 0x51, 0x31, 0x64, 0x4a, 0xfb, 0xdb, - 0xa7, 0x50, 0xdb, 0x67, 0x5e, 0x85, 0x1a, 0x4e, 0x67, 0xd9, 0x43, 0xc2, 0x3a, 0xda, 0x41, 0x07, - 0x31, 0x88, 0x7e, 0x86, 0x77, 0x3e, 0xf7, 0x89, 0x35, 0x34, 0x82, 0xa1, 0xc5, 0xa6, 0xcc, 0x17, - 0xc3, 0xaa, 0xb4, 0xcf, 0x9f, 0x42, 0xed, 0x99, 0xe5, 0x65, 0x2d, 0x69, 0x3b, 0xd6, 0x2b, 0x02, - 0xb8, 0x0c, 0xae, 0x23, 0x35, 0x0a, 0x4d, 0x1d, 0x6e, 0x4c, 0xb6, 0xa1, 0x95, 0x6d, 0xe8, 0xb4, - 0xe5, 0x65, 0xe8, 0xb4, 0x1d, 0xeb, 0x15, 0x01, 0xac, 0x43, 0xfb, 0x70, 0x34, 0x25, 0xf3, 0xa8, - 0xb2, 0x19, 0x33, 0xa9, 0xeb, 0x0d, 0x7d, 0x3e, 0x74, 0x08, 0x73, 0xd5, 0x9c, 0xc8, 0x70, 0xf1, - 0x14, 0x6a, 0xfb, 0x09, 0xab, 0x50, 0xfb, 0x2c, 0x9d, 0x68, 0x2f, 0x0d, 0xeb, 0x68, 0x4a, 0xe6, - 0x83, 0x35, 0x7c, 0xcb, 0x07, 0x11, 0x38, 0x83, 0xf2, 0x4e, 0x83, 0xd1, 0x57, 0x50, 0x8c, 0x9b, - 0xc9, 0xcc, 0x78, 0x18, 0xdb, 0x1f, 0xaf, 0x42, 0xed, 0x78, 0x5f, 0xbb, 0x99, 0x89, 0xf5, 0x82, - 0x10, 0x7b, 0x26, 0x6a, 0x81, 0x42, 0x1c, 0xe6, 0xa9, 0xd9, 0xba, 0x1c, 0xf9, 0x24, 0x63, 0x72, - 0x98, 0xf6, 0x8b, 0x18, 0x58, 0x17, 0x44, 0xfc, 0x35, 0xa0, 0x41, 0xb4, 0x9c, 0x3a, 0x74, 0x46, - 0x2d, 0xee, 0x50, 0xb7, 0x43, 0x7c, 0x82, 0x3e, 0x81, 0x52, 0x32, 0x77, 0xbd, 0x4e, 0xf2, 0x18, - 0xb6, 0x40, 0x3c, 0xd0, 0xf8, 0x1f, 0x09, 0xca, 0xc9, 0xcb, 0x11, 0x3e, 0x08, 0x14, 0x9b, 0x4c, - 0x69, 0x42, 0x17, 0xf2, 0xf3, 0x5d, 0x95, 0xfd, 0xdf, 0x5d, 0x25, 0xa7, 0x77, 0x55, 0x0f, 0x76, - 0xd7, 0x8d, 0xaa, 0x7c, 0xc0, 0xaa, 0xfa, 0x12, 0xf2, 0xc9, 0x0a, 0xc9, 0xbd, 0x65, 0x85, 0x24, - 0xe4, 0xf6, 0xf7, 0x7f, 0x2d, 0x6b, 0xd2, 0xfd, 0xb2, 0x26, 0x3d, 0x2c, 0x6b, 0xd2, 0xbf, 0xcb, - 0x9a, 0xf4, 0xfb, 0x63, 0x2d, 0xf3, 0xf0, 0x58, 0xcb, 0xfc, 0xfd, 0x58, 0xcb, 0xfc, 0xd2, 0x18, - 0x33, 0x7f, 0x12, 0x8c, 0x9a, 0x06, 0x9f, 0xb6, 0x92, 0x70, 0xe2, 0xdb, 0x9a, 0xb7, 0x36, 0x3f, - 0x0b, 0x7f, 0xe1, 0x50, 0x6f, 0x94, 0x17, 0xeb, 0xff, 0xfc, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, - 0xcb, 0x00, 0xd5, 0xe0, 0x45, 0x06, 0x00, 0x00, -} - -func (this *Project) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Project) - if !ok { - that2, ok := that.(Project) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Index != that1.Index { - return false - } - if this.Subscription != that1.Subscription { - return false - } - if this.Description != that1.Description { - return false - } - if this.Enabled != that1.Enabled { - return false - } - if len(this.ProjectKeys) != len(that1.ProjectKeys) { - return false - } - for i := range this.ProjectKeys { - if !this.ProjectKeys[i].Equal(&that1.ProjectKeys[i]) { - return false - } - } - if !this.AdminPolicy.Equal(that1.AdminPolicy) { - return false - } - if this.UsedCu != that1.UsedCu { - return false - } - if !this.SubscriptionPolicy.Equal(that1.SubscriptionPolicy) { - return false - } - if this.Snapshot != that1.Snapshot { - return false - } - return true -} -func (this *ProjectKey) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ProjectKey) - if !ok { - that2, ok := that.(ProjectKey) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Key != that1.Key { - return false - } - if this.Kinds != that1.Kinds { - return false - } - return true -} -func (this *Policy) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Policy) - if !ok { - that2, ok := that.(Policy) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.ChainPolicies) != len(that1.ChainPolicies) { - return false - } - for i := range this.ChainPolicies { - if !this.ChainPolicies[i].Equal(&that1.ChainPolicies[i]) { - return false - } - } - if this.GeolocationProfile != that1.GeolocationProfile { - return false - } - if this.TotalCuLimit != that1.TotalCuLimit { - return false - } - if this.EpochCuLimit != that1.EpochCuLimit { - return false - } - if this.MaxProvidersToPair != that1.MaxProvidersToPair { - return false - } - return true -} -func (this *ChainPolicy) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ChainPolicy) - if !ok { - that2, ok := that.(ChainPolicy) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ChainId != that1.ChainId { - return false - } - if len(this.Apis) != len(that1.Apis) { - return false - } - for i := range this.Apis { - if this.Apis[i] != that1.Apis[i] { - return false - } - } - return true -} -func (this *ProtoDeveloperData) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ProtoDeveloperData) - if !ok { - that2, ok := that.(ProtoDeveloperData) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ProjectID != that1.ProjectID { - return false - } - return true -} -func (this *ProjectData) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ProjectData) - if !ok { - that2, ok := that.(ProjectData) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if this.Description != that1.Description { - return false - } - if this.Enabled != that1.Enabled { - return false - } - if len(this.ProjectKeys) != len(that1.ProjectKeys) { - return false - } - for i := range this.ProjectKeys { - if !this.ProjectKeys[i].Equal(&that1.ProjectKeys[i]) { - return false - } - } - if !this.Policy.Equal(that1.Policy) { - return false - } - return true -} -func (m *Project) 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 *Project) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Project) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Snapshot != 0 { - i = encodeVarintProject(dAtA, i, uint64(m.Snapshot)) - i-- - dAtA[i] = 0x48 - } - if m.SubscriptionPolicy != nil { - { - size, err := m.SubscriptionPolicy.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProject(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if m.UsedCu != 0 { - i = encodeVarintProject(dAtA, i, uint64(m.UsedCu)) - i-- - dAtA[i] = 0x38 - } - if m.AdminPolicy != nil { - { - size, err := m.AdminPolicy.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProject(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if len(m.ProjectKeys) > 0 { - for iNdEx := len(m.ProjectKeys) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ProjectKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProject(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if m.Enabled { - i-- - if m.Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintProject(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x1a - } - if len(m.Subscription) > 0 { - i -= len(m.Subscription) - copy(dAtA[i:], m.Subscription) - i = encodeVarintProject(dAtA, i, uint64(len(m.Subscription))) - i-- - dAtA[i] = 0x12 - } - if len(m.Index) > 0 { - i -= len(m.Index) - copy(dAtA[i:], m.Index) - i = encodeVarintProject(dAtA, i, uint64(len(m.Index))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ProjectKey) 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 *ProjectKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProjectKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Kinds != 0 { - i = encodeVarintProject(dAtA, i, uint64(m.Kinds)) - i-- - dAtA[i] = 0x20 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintProject(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Policy) 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 *Policy) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Policy) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.MaxProvidersToPair != 0 { - i = encodeVarintProject(dAtA, i, uint64(m.MaxProvidersToPair)) - i-- - dAtA[i] = 0x28 - } - if m.EpochCuLimit != 0 { - i = encodeVarintProject(dAtA, i, uint64(m.EpochCuLimit)) - i-- - dAtA[i] = 0x20 - } - if m.TotalCuLimit != 0 { - i = encodeVarintProject(dAtA, i, uint64(m.TotalCuLimit)) - i-- - dAtA[i] = 0x18 - } - if m.GeolocationProfile != 0 { - i = encodeVarintProject(dAtA, i, uint64(m.GeolocationProfile)) - i-- - dAtA[i] = 0x10 - } - if len(m.ChainPolicies) > 0 { - for iNdEx := len(m.ChainPolicies) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ChainPolicies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProject(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ChainPolicy) 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 *ChainPolicy) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChainPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Apis) > 0 { - for iNdEx := len(m.Apis) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Apis[iNdEx]) - copy(dAtA[i:], m.Apis[iNdEx]) - i = encodeVarintProject(dAtA, i, uint64(len(m.Apis[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintProject(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ProtoDeveloperData) 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 *ProtoDeveloperData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProtoDeveloperData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ProjectID) > 0 { - i -= len(m.ProjectID) - copy(dAtA[i:], m.ProjectID) - i = encodeVarintProject(dAtA, i, uint64(len(m.ProjectID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ProjectData) 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 *ProjectData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProjectData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Policy != nil { - { - size, err := m.Policy.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProject(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if len(m.ProjectKeys) > 0 { - for iNdEx := len(m.ProjectKeys) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ProjectKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProject(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.Enabled { - i-- - if m.Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintProject(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintProject(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintProject(dAtA []byte, offset int, v uint64) int { - offset -= sovProject(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Project) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Index) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - l = len(m.Subscription) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - if m.Enabled { - n += 2 - } - if len(m.ProjectKeys) > 0 { - for _, e := range m.ProjectKeys { - l = e.Size() - n += 1 + l + sovProject(uint64(l)) - } - } - if m.AdminPolicy != nil { - l = m.AdminPolicy.Size() - n += 1 + l + sovProject(uint64(l)) - } - if m.UsedCu != 0 { - n += 1 + sovProject(uint64(m.UsedCu)) - } - if m.SubscriptionPolicy != nil { - l = m.SubscriptionPolicy.Size() - n += 1 + l + sovProject(uint64(l)) - } - if m.Snapshot != 0 { - n += 1 + sovProject(uint64(m.Snapshot)) - } - return n -} - -func (m *ProjectKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - if m.Kinds != 0 { - n += 1 + sovProject(uint64(m.Kinds)) - } - return n -} - -func (m *Policy) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ChainPolicies) > 0 { - for _, e := range m.ChainPolicies { - l = e.Size() - n += 1 + l + sovProject(uint64(l)) - } - } - if m.GeolocationProfile != 0 { - n += 1 + sovProject(uint64(m.GeolocationProfile)) - } - if m.TotalCuLimit != 0 { - n += 1 + sovProject(uint64(m.TotalCuLimit)) - } - if m.EpochCuLimit != 0 { - n += 1 + sovProject(uint64(m.EpochCuLimit)) - } - if m.MaxProvidersToPair != 0 { - n += 1 + sovProject(uint64(m.MaxProvidersToPair)) - } - return n -} - -func (m *ChainPolicy) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - if len(m.Apis) > 0 { - for _, s := range m.Apis { - l = len(s) - n += 1 + l + sovProject(uint64(l)) - } - } - return n -} - -func (m *ProtoDeveloperData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ProjectID) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - return n -} - -func (m *ProjectData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProject(uint64(l)) - } - if m.Enabled { - n += 2 - } - if len(m.ProjectKeys) > 0 { - for _, e := range m.ProjectKeys { - l = e.Size() - n += 1 + l + sovProject(uint64(l)) - } - } - if m.Policy != nil { - l = m.Policy.Size() - n += 1 + l + sovProject(uint64(l)) - } - return n -} - -func sovProject(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozProject(x uint64) (n int) { - return sovProject(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Project) 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 ErrIntOverflowProject - } - 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: Project: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Project: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Index = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subscription", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Subscription = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Enabled = bool(v != 0) - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProjectKeys", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProjectKeys = append(m.ProjectKeys, ProjectKey{}) - if err := m.ProjectKeys[len(m.ProjectKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AdminPolicy", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AdminPolicy == nil { - m.AdminPolicy = &Policy{} - } - if err := m.AdminPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UsedCu", wireType) - } - m.UsedCu = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.UsedCu |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SubscriptionPolicy", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SubscriptionPolicy == nil { - m.SubscriptionPolicy = &Policy{} - } - if err := m.SubscriptionPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Snapshot", wireType) - } - m.Snapshot = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Snapshot |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipProject(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProject - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProjectKey) 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 ErrIntOverflowProject - } - 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: ProjectKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProjectKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Kinds", wireType) - } - m.Kinds = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Kinds |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipProject(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProject - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Policy) 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 ErrIntOverflowProject - } - 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: Policy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Policy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainPolicies", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainPolicies = append(m.ChainPolicies, ChainPolicy{}) - if err := m.ChainPolicies[len(m.ChainPolicies)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GeolocationProfile", wireType) - } - m.GeolocationProfile = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GeolocationProfile |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalCuLimit", wireType) - } - m.TotalCuLimit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalCuLimit |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochCuLimit", wireType) - } - m.EpochCuLimit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EpochCuLimit |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxProvidersToPair", wireType) - } - m.MaxProvidersToPair = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxProvidersToPair |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipProject(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProject - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ChainPolicy) 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 ErrIntOverflowProject - } - 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: ChainPolicy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChainPolicy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Apis", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Apis = append(m.Apis, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProject(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProject - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProtoDeveloperData) 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 ErrIntOverflowProject - } - 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: ProtoDeveloperData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProtoDeveloperData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProjectID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProjectID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProject(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProject - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProjectData) 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 ErrIntOverflowProject - } - 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: ProjectData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProjectData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Enabled = bool(v != 0) - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProjectKeys", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProjectKeys = append(m.ProjectKeys, ProjectKey{}) - if err := m.ProjectKeys[len(m.ProjectKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Policy", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProject - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProject - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProject - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Policy == nil { - m.Policy = &Policy{} - } - if err := m.Policy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProject(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProject - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipProject(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProject - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProject - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProject - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthProject - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupProject - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthProject - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthProject = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowProject = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupProject = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/projects/module.go b/x/projects/module.go index 2e78ef4414..50e6962d03 100644 --- a/x/projects/module.go +++ b/x/projects/module.go @@ -127,26 +127,6 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { migrator := keeper.NewMigrator(am.keeper) - // register v2 -> v3 migration - if err := cfg.RegisterMigration(types.ModuleName, 2, migrator.Migrate2to3); err != nil { - // panic:ok: at start up, migration cannot proceed anyhow - panic(fmt.Errorf("%s: failed to register migration to v3: %w", types.ModuleName, err)) - } - // register v3 -> v4 migration - if err := cfg.RegisterMigration(types.ModuleName, 3, migrator.Migrate3to4); err != nil { - // panic:ok: at start up, migration cannot proceed anyhow - panic(fmt.Errorf("%s: failed to register migration to v4: %w", types.ModuleName, err)) - } - // register v4 -> v5 migration - if err := cfg.RegisterMigration(types.ModuleName, 4, migrator.Migrate4to5); err != nil { - // panic:ok: at start up, migration cannot proceed anyhow - panic(fmt.Errorf("%s: failed to register migration to v5: %w", types.ModuleName, err)) - } - // register v5 -> v6 migration - if err := cfg.RegisterMigration(types.ModuleName, 5, migrator.Migrate5to6); err != nil { - // panic:ok: at start up, migration cannot proceed anyhow - panic(fmt.Errorf("%s: failed to register migration to v5: %w", types.ModuleName, err)) - } // register v6 -> v7 migration if err := cfg.RegisterMigration(types.ModuleName, 6, migrator.Migrate6to7); err != nil { // panic:ok: at start up, migration cannot proceed anyhow diff --git a/x/projects/module_simulation.go b/x/projects/module_simulation.go deleted file mode 100644 index b2039803ff..0000000000 --- a/x/projects/module_simulation.go +++ /dev/null @@ -1,119 +0,0 @@ -package projects - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/testutil/sims" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/v4/testutil/sample" - projectssimulation "github.com/lavanet/lava/v4/x/projects/simulation" - "github.com/lavanet/lava/v4/x/projects/types" -) - -// avoid unused import issue -var ( - _ = sample.AccAddress - _ = projectssimulation.FindAccount - _ = sims.StakePerAccount - _ = simulation.MsgEntryKind - _ = baseapp.Paramspace -) - -const ( - opWeightMsgAddKeys = "op_weight_msg_add_keys" - // TODO: Determine the simulation weight value - defaultWeightMsgAddKeys int = 100 - - opWeightMsgDelKeys = "op_weight_msg_del_keys" - // TODO: Determine the simulation weight value - defaultWeightMsgDelKeys int = 100 - - opWeightMsgSetPolicy = "op_weight_msg_set_admin_policy" - // TODO: Determine the simulation weight value - defaultWeightMsgSetPolicy int = 100 - - opWeightMsgSetSubscriptionPolicy = "op_weight_msg_set_subscription_policy" - // TODO: Determine the simulation weight value - defaultWeightMsgSetSubscriptionPolicy int = 100 - - // this line is used by starport scaffolding # simapp/module/const -) - -// GenerateGenesisState creates a randomized GenState of the module -func (AppModule) GenerateGenesisState(simState *module.SimulationState) { - accs := make([]string, len(simState.Accounts)) - for i, acc := range simState.Accounts { - accs[i] = acc.Address.String() - } - projectsGenesis := types.GenesisState{ - Params: types.DefaultParams(), - // this line is used by starport scaffolding # simapp/module/genesisState - } - simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&projectsGenesis) -} - -// ProposalContents doesn't return any content functions for governance proposals -func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalMsg { - return nil -} - -// RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} - -// WeightedOperations returns the all the gov module operations with their respective weights. -func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { - operations := make([]simtypes.WeightedOperation, 0) - - var weightMsgAddKeys int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgAddKeys, &weightMsgAddKeys, nil, - func(_ *rand.Rand) { - weightMsgAddKeys = defaultWeightMsgAddKeys - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgAddKeys, - projectssimulation.SimulateMsgAddKeys(am.keeper), - )) - - var weightMsgDelKeys int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgDelKeys, &weightMsgDelKeys, nil, - func(_ *rand.Rand) { - weightMsgDelKeys = defaultWeightMsgDelKeys - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgDelKeys, - projectssimulation.SimulateMsgDelKeys(am.keeper), - )) - - var weightMsgSetPolicy int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgSetPolicy, &weightMsgSetPolicy, nil, - func(_ *rand.Rand) { - weightMsgSetPolicy = defaultWeightMsgSetPolicy - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgSetPolicy, - projectssimulation.SimulateMsgSetPolicy(am.keeper), - )) - - var weightMsgSetSubscriptionPolicy int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgSetSubscriptionPolicy, &weightMsgSetSubscriptionPolicy, nil, - func(_ *rand.Rand) { - weightMsgSetSubscriptionPolicy = defaultWeightMsgSetSubscriptionPolicy - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgSetSubscriptionPolicy, - projectssimulation.SimulateMsgSetSubscriptionPolicy(am.keeper), - )) - - // this line is used by starport scaffolding # simapp/module/operation - - return operations -} diff --git a/x/projects/simulation/add_project_keys.go b/x/projects/simulation/add_project_keys.go deleted file mode 100644 index 98f1b06a10..0000000000 --- a/x/projects/simulation/add_project_keys.go +++ /dev/null @@ -1,27 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v4/x/projects/keeper" - "github.com/lavanet/lava/v4/x/projects/types" -) - -func SimulateMsgAddKeys( - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - msg := &types.MsgAddKeys{ - Creator: simAccount.Address.String(), - } - - // TODO: Handling the AddKeys simulation - - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "AddKeys simulation not implemented"), nil, nil - } -} diff --git a/x/projects/simulation/del_project_keys.go b/x/projects/simulation/del_project_keys.go deleted file mode 100644 index 272b112a64..0000000000 --- a/x/projects/simulation/del_project_keys.go +++ /dev/null @@ -1,27 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v4/x/projects/keeper" - "github.com/lavanet/lava/v4/x/projects/types" -) - -func SimulateMsgDelKeys( - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - msg := &types.MsgDelKeys{ - Creator: simAccount.Address.String(), - } - - // TODO: Handling the DelKeys simulation - - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "DelKeys simulation not implemented"), nil, nil - } -} diff --git a/x/projects/simulation/set_admin_policy.go b/x/projects/simulation/set_admin_policy.go deleted file mode 100644 index 90a10e8bc4..0000000000 --- a/x/projects/simulation/set_admin_policy.go +++ /dev/null @@ -1,27 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v4/x/projects/keeper" - "github.com/lavanet/lava/v4/x/projects/types" -) - -func SimulateMsgSetPolicy( - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - msg := &types.MsgSetPolicy{ - Creator: simAccount.Address.String(), - } - - // TODO: Handling the SetPolicy simulation - - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "SetPolicy simulation not implemented"), nil, nil - } -} diff --git a/x/projects/simulation/set_subscription_policy.go b/x/projects/simulation/set_subscription_policy.go deleted file mode 100644 index 21fecf1405..0000000000 --- a/x/projects/simulation/set_subscription_policy.go +++ /dev/null @@ -1,27 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v4/x/projects/keeper" - "github.com/lavanet/lava/v4/x/projects/types" -) - -func SimulateMsgSetSubscriptionPolicy( - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - msg := &types.MsgSetSubscriptionPolicy{ - Creator: simAccount.Address.String(), - } - - // TODO: Handling the SetSubscriptionPolicy simulation - - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "SetSubscriptionPolicy simulation not implemented"), nil, nil - } -} diff --git a/x/projects/simulation/simap.go b/x/projects/simulation/simap.go deleted file mode 100644 index 92c437c0d1..0000000000 --- a/x/projects/simulation/simap.go +++ /dev/null @@ -1,15 +0,0 @@ -package simulation - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" -) - -// FindAccount find a specific address from an account list -func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { - creator, err := sdk.AccAddressFromBech32(address) - if err != nil { - panic(err) - } - return simtypes.FindAccount(accs, creator) -} diff --git a/x/protocol/module_simulation.go b/x/protocol/module_simulation.go deleted file mode 100644 index 60a67b4d0f..0000000000 --- a/x/protocol/module_simulation.go +++ /dev/null @@ -1,79 +0,0 @@ -package protocol - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/testutil/sims" - types2 "github.com/cosmos/cosmos-sdk/x/auth/types" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/v4/testutil/sample" - protocolsimulation "github.com/lavanet/lava/v4/x/protocol/simulation" - "github.com/lavanet/lava/v4/x/protocol/types" -) - -// avoid unused import issue -var ( - _ = sample.AccAddress - _ = protocolsimulation.FindAccount - _ = sims.StakePerAccount - _ = simulation.MsgEntryKind - _ = baseapp.Paramspace -) - -const ( -// this line is used by starport scaffolding # simapp/module/const -) - -// GenerateGenesisState creates a randomized GenState of the module -func (AppModule) GenerateGenesisState(simState *module.SimulationState) { - accs := make([]string, len(simState.Accounts)) - for i, acc := range simState.Accounts { - accs[i] = acc.Address.String() - } - protocolGenesis := types.GenesisState{ - Params: types.DefaultParams(), - // this line is used by starport scaffolding # simapp/module/genesisState - } - simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&protocolGenesis) -} - -// ProposalContents doesn't return any content functions for governance proposals -func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalMsg { - return nil -} - -// TODO: Add weighted proposals -func (AppModule) ProposalMsgs(_ module.SimulationState) []simtypes.WeightedProposalMsg { - return []simtypes.WeightedProposalMsg{ - simulation.NewWeightedProposalMsg("op_weight_msg_update_params", 100, func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { - return &types2.MsgUpdateParams{} - }), - } -} - -//// RandomizedParams creates randomized param changes for the simulator -// func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { -// protocolParams := types.DefaultParams() -// return []simtypes.ParamChange{ -// simulation.NewSimParamChange(types.ModuleName, string(types.KeyVersion), func(r *rand.Rand) string { -// return string(types.Amino.MustMarshalJSON(protocolParams.Version)) -// }), -// } -// } - -// RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} - -// WeightedOperations returns the all the gov module operations with their respective weights. -func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { - operations := make([]simtypes.WeightedOperation, 0) - - // this line is used by starport scaffolding # simapp/module/operation - - return operations -} diff --git a/x/protocol/simulation/simap.go b/x/protocol/simulation/simap.go deleted file mode 100644 index 92c437c0d1..0000000000 --- a/x/protocol/simulation/simap.go +++ /dev/null @@ -1,15 +0,0 @@ -package simulation - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" -) - -// FindAccount find a specific address from an account list -func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { - creator, err := sdk.AccAddressFromBech32(address) - if err != nil { - panic(err) - } - return simtypes.FindAccount(accs, creator) -} diff --git a/x/rewards/module_simulation.go b/x/rewards/module_simulation.go deleted file mode 100644 index a5f6613792..0000000000 --- a/x/rewards/module_simulation.go +++ /dev/null @@ -1,56 +0,0 @@ -package rewards - -import ( - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/v4/testutil/sample" - rewardssimulation "github.com/lavanet/lava/v4/x/rewards/simulation" - "github.com/lavanet/lava/v4/x/rewards/types" -) - -// avoid unused import issue -var ( - _ = sample.AccAddress - _ = rewardssimulation.FindAccount - _ = sims.StakePerAccount - _ = simulation.MsgEntryKind - _ = baseapp.Paramspace -) - -const ( -// this line is used by starport scaffolding # simapp/module/const -) - -// GenerateGenesisState creates a randomized GenState of the module -func (AppModule) GenerateGenesisState(simState *module.SimulationState) { - accs := make([]string, len(simState.Accounts)) - for i, acc := range simState.Accounts { - accs[i] = acc.Address.String() - } - rewardsGenesis := types.GenesisState{ - Params: types.DefaultParams(), - // this line is used by starport scaffolding # simapp/module/genesisState - } - simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&rewardsGenesis) -} - -// ProposalContents doesn't return any content functions for governance proposals -func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalMsg { - return nil -} - -// RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} - -// WeightedOperations returns the all the gov module operations with their respective weights. -func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { - operations := make([]simtypes.WeightedOperation, 0) - - // this line is used by starport scaffolding # simapp/module/operation - - return operations -} diff --git a/x/rewards/simulation/simap.go b/x/rewards/simulation/simap.go deleted file mode 100644 index 92c437c0d1..0000000000 --- a/x/rewards/simulation/simap.go +++ /dev/null @@ -1,15 +0,0 @@ -package simulation - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" -) - -// FindAccount find a specific address from an account list -func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { - creator, err := sdk.AccAddressFromBech32(address) - if err != nil { - panic(err) - } - return simtypes.FindAccount(accs, creator) -} diff --git a/x/spec/keeper/migrations.go b/x/spec/keeper/migrations.go index f39fdc02f5..d9126c23ad 100644 --- a/x/spec/keeper/migrations.go +++ b/x/spec/keeper/migrations.go @@ -1,8 +1,6 @@ package keeper import ( - "strings" - "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/x/spec/types" @@ -17,15 +15,6 @@ func NewMigrator(keeper Keeper) Migrator { return Migrator{keeper: keeper} } -func (m Migrator) Migrate2to3(ctx sdk.Context) error { - specs := m.keeper.GetAllSpec(ctx) - for _, spec := range specs { - spec.Name = strings.ToLower(spec.Name) - m.keeper.SetSpec(ctx, spec) - } - return nil -} - func (m Migrator) Migrate3to4(ctx sdk.Context) error { store := prefix.NewStore(ctx.KVStore(m.keeper.storeKey), types.KeyPrefix(types.SpecKeyPrefix)) iterator := sdk.KVStorePrefixIterator(store, []byte{}) diff --git a/x/spec/module.go b/x/spec/module.go index 7fbe7731ce..d456e4313c 100644 --- a/x/spec/module.go +++ b/x/spec/module.go @@ -130,12 +130,6 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { migrator := keeper.NewMigrator(am.keeper) - // register v2 -> v3 migration - if err := cfg.RegisterMigration(types.ModuleName, 2, migrator.Migrate2to3); err != nil { - // panic:ok: at start up, migration cannot proceed anyhow - panic(fmt.Errorf("%s: failed to register migration to v3: %w", types.ModuleName, err)) - } - // register v3 -> v4 migration if err := cfg.RegisterMigration(types.ModuleName, 3, migrator.Migrate3to4); err != nil { // panic:ok: at start up, migration cannot proceed anyhow diff --git a/x/spec/module_simulation.go b/x/spec/module_simulation.go deleted file mode 100644 index 63eb972e93..0000000000 --- a/x/spec/module_simulation.go +++ /dev/null @@ -1,55 +0,0 @@ -package spec - -import ( - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/testutil/sims" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/v4/testutil/sample" - specsimulation "github.com/lavanet/lava/v4/x/spec/simulation" - "github.com/lavanet/lava/v4/x/spec/types" -) - -// avoid unused import issue -var ( - _ = sample.AccAddress - _ = specsimulation.FindAccount - _ = sims.StakePerAccount - _ = simulation.MsgEntryKind - _ = baseapp.Paramspace -) - -const ( -// this line is used by starport scaffolding # simapp/module/const -) - -// GenerateGenesisState creates a randomized GenState of the module -func (AppModule) GenerateGenesisState(simState *module.SimulationState) { - accs := make([]string, len(simState.Accounts)) - for i, acc := range simState.Accounts { - accs[i] = acc.Address.String() - } - specGenesis := types.GenesisState{ - // this line is used by starport scaffolding # simapp/module/genesisState - } - simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&specGenesis) -} - -// ProposalContents doesn't return any content functions for governance proposals -func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalMsg { - return nil -} - -// RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} - -// WeightedOperations returns the all the gov module operations with their respective weights. -func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { - operations := make([]simtypes.WeightedOperation, 0) - - // this line is used by starport scaffolding # simapp/module/operation - - return operations -} diff --git a/x/spec/simulation/simap.go b/x/spec/simulation/simap.go deleted file mode 100644 index 92c437c0d1..0000000000 --- a/x/spec/simulation/simap.go +++ /dev/null @@ -1,15 +0,0 @@ -package simulation - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" -) - -// FindAccount find a specific address from an account list -func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { - creator, err := sdk.AccAddressFromBech32(address) - if err != nil { - panic(err) - } - return simtypes.FindAccount(accs, creator) -} diff --git a/x/subscription/keeper/migrations.go b/x/subscription/keeper/migrations.go index 22aebf0452..56168236ed 100644 --- a/x/subscription/keeper/migrations.go +++ b/x/subscription/keeper/migrations.go @@ -2,16 +2,10 @@ package keeper import ( "fmt" - "time" - "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lavanet/lava/v4/utils" - v2 "github.com/lavanet/lava/v4/x/subscription/migrations/v2" - v5 "github.com/lavanet/lava/v4/x/subscription/migrations/v5" - v6 "github.com/lavanet/lava/v4/x/subscription/migrations/v6" v8 "github.com/lavanet/lava/v4/x/subscription/migrations/v8" - "github.com/lavanet/lava/v4/x/subscription/types" ) type Migrator struct { @@ -22,168 +16,6 @@ func NewMigrator(keeper Keeper) Migrator { return Migrator{keeper: keeper} } -// Migrate2to3 implements store migration from v2 to v3: -// - Convert subscription store to fixation store and use timers -func (m Migrator) Migrate2to3(ctx sdk.Context) error { - utils.LavaFormatDebug("migrate: subscriptions") - - keeper := m.keeper - - store := prefix.NewStore( - ctx.KVStore(keeper.storeKey), - v2.KeyPrefix(v2.SubscriptionKeyPrefix), - ) - - iterator := sdk.KVStorePrefixIterator(store, []byte{}) - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var sub_V2 v2.Subscription - keeper.cdc.MustUnmarshal(iterator.Value(), &sub_V2) - - utils.LavaFormatDebug("migrate:", - utils.Attribute{Key: "subscription", Value: sub_V2.Consumer}) - - sub_V3 := types.Subscription{ - Creator: sub_V2.Creator, - Consumer: sub_V2.Consumer, - Block: sub_V2.Block, - PlanIndex: sub_V2.PlanIndex, - PlanBlock: sub_V2.PlanBlock, - DurationTotal: sub_V2.DurationTotal, - DurationLeft: sub_V2.DurationLeft, - MonthExpiryTime: sub_V2.MonthExpiryTime, - MonthCuTotal: sub_V2.MonthCuTotal, - MonthCuLeft: sub_V2.MonthCuLeft, - } - - // each subscription entry in V2 store should have an entry in V3 store - err := keeper.subsFS.AppendEntry(ctx, sub_V3.Consumer, sub_V3.Block, &sub_V3) - if err != nil { - return fmt.Errorf("%w: subscriptions %s", err, sub_V3.Consumer) - } - - // if the subscription has expired, then delete the entry from V3 store to induce - // stale-period state (use the block of last expiry as the block for deletion). - // otherwise, the subscription is alive, but the current month may have expired - // between since the upgrade proposal took effect (and until now); if indeed so, - // then invoke advanceMonth() since the current block is the (month) expiry block. - // otherwise, set the timer for the monthly expiry as already was set in V2. - if sub_V3.DurationLeft > 0 { - expiry := sub_V2.MonthExpiryTime - if expiry <= uint64(ctx.BlockTime().UTC().Unix()) { - utils.LavaFormatDebug(" subscription live, month expired", - utils.Attribute{Key: "expiry", Value: time.Unix(int64(expiry), 0)}, - utils.Attribute{Key: "blockTime", Value: ctx.BlockTime().UTC()}, - ) - keeper.advanceMonth(ctx, []byte(sub_V3.Consumer)) - } else { - utils.LavaFormatDebug(" subscription live, future expiry", - utils.Attribute{Key: "expiry", Value: time.Unix(int64(expiry), 0)}, - utils.Attribute{Key: "blockTime", Value: ctx.BlockTime().UTC()}, - ) - keeper.subsTS.AddTimerByBlockTime(ctx, expiry, []byte(sub_V3.Consumer), []byte{}) - } - } else { - utils.LavaFormatDebug(" subscription deleted", - utils.Attribute{Key: "block", Value: sub_V2.PrevExpiryBlock}) - keeper.subsFS.DelEntry(ctx, sub_V3.Consumer, sub_V2.PrevExpiryBlock) - } - - store.Delete(iterator.Key()) - } - - return nil -} - -// Migrate3to4 implements store migration from v3 to v4: -// -- trigger fixation migration (v4->v5), initialize IsLatest field -func (m Migrator) Migrate3to4(ctx sdk.Context) error { - // This migration used to call a deprecated fixationstore function called MigrateVersionAndPrefix - - return nil -} - -// Migrate4to5 implements store migration from v4 to v5: -// -- rename the DurationTotal field to DurationBought -// -- introduce two new fields: DurationTotal (with new meaning) and cluster -// -- assign the subscription's cluster -func (m Migrator) Migrate4to5(ctx sdk.Context) error { - utils.LavaFormatDebug("migrate 4->5: subscriptions") - - keeper := m.keeper - - indices := keeper.subsFS.AllEntryIndicesFilter(ctx, "", nil) - for _, ind := range indices { - blocks := keeper.subsFS.GetAllEntryVersions(ctx, ind) - - for _, block := range blocks { - var sub_V5 v5.Subscription - keeper.subsFS.ReadEntry(ctx, ind, block, &sub_V5) - utils.LavaFormatDebug("migrate:", - utils.Attribute{Key: "subscription", Value: sub_V5.Consumer}) - - sub_V5.Cluster = v5.GetClusterKey(sub_V5) - - keeper.subsFS.ModifyEntry(ctx, ind, block, &sub_V5) - } - } - return nil -} - -// Migrate5to6 implements store migration from v5 to v6: -// -- find old subscriptions and trigger advance month to make them expire -func (m Migrator) Migrate5to6(ctx sdk.Context) error { - indices := m.keeper.GetAllSubscriptionsIndices(ctx) - currentTime := ctx.BlockTime().UTC().Unix() - for _, ind := range indices { - sub, found := m.keeper.GetSubscription(ctx, ind) - if !found { - utils.LavaFormatError("cannot migrate sub", fmt.Errorf("sub not found"), - utils.Attribute{Key: "sub", Value: sub}, - ) - } - - if sub.MonthExpiryTime < uint64(currentTime) { - m.keeper.advanceMonth(ctx, []byte(ind)) - } - } - - return nil -} - -// Migrate6to7 implements store migration from v6 to v7: -// -- if subscription's auto_renewal = true, set auto_renewal_next_plan to the current's subscription plan -func (m Migrator) Migrate6to7(ctx sdk.Context) error { - utils.LavaFormatDebug("migrate 6->7: subscriptions") - - for _, index := range m.keeper.subsFS.GetAllEntryIndices(ctx) { - for _, block := range m.keeper.subsFS.GetAllEntryVersions(ctx, index) { - var subscriptionV6 v6.Subscription - var subscriptionV7 types.Subscription - foundOld := m.keeper.subsFS.FindEntry(ctx, index, block, &subscriptionV6) - foundNew := m.keeper.subsFS.FindEntry(ctx, index, block, &subscriptionV7) - if !foundOld || !foundNew { - utils.LavaFormatError("cannot migrate sub", fmt.Errorf("sub not found"), - utils.Attribute{Key: "index", Value: index}, - utils.Attribute{Key: "block", Value: block}, - ) - continue - } - - if subscriptionV6.AutoRenewal { - subscriptionV7.AutoRenewalNextPlan = subscriptionV7.PlanIndex - } else { - subscriptionV7.AutoRenewalNextPlan = types.AUTO_RENEWAL_PLAN_NONE - } - - m.keeper.subsFS.ModifyEntry(ctx, index, block, &subscriptionV7) - } - } - - return nil -} - // Migrate7to8 implements store migration from v7 to v8: // init new credit field func (m Migrator) Migrate7to8(ctx sdk.Context) error { diff --git a/x/subscription/migrations/v2/keys.go b/x/subscription/migrations/v2/keys.go deleted file mode 100644 index c2d634384d..0000000000 --- a/x/subscription/migrations/v2/keys.go +++ /dev/null @@ -1,10 +0,0 @@ -package types - -const ( - // SubscriptionKeyPrefix is the prefix to retrieve all Subscription - SubscriptionKeyPrefix = "Subscribe/value/" -) - -func KeyPrefix(p string) []byte { - return []byte(p) -} diff --git a/x/subscription/migrations/v2/subscription.pb.go b/x/subscription/migrations/v2/subscription.pb.go deleted file mode 100644 index 6ff3bdcf4a..0000000000 --- a/x/subscription/migrations/v2/subscription.pb.go +++ /dev/null @@ -1,744 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: subscription/subscription.proto - -package types - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Subscription struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - Consumer string `protobuf:"bytes,2,opt,name=consumer,proto3" json:"consumer,omitempty"` - Block uint64 `protobuf:"varint,3,opt,name=block,proto3" json:"block,omitempty"` - PlanIndex string `protobuf:"bytes,4,opt,name=plan_index,json=planIndex,proto3" json:"plan_index,omitempty"` - PlanBlock uint64 `protobuf:"varint,5,opt,name=plan_block,json=planBlock,proto3" json:"plan_block,omitempty"` - DurationTotal uint64 `protobuf:"varint,6,opt,name=duration_total,json=durationTotal,proto3" json:"duration_total,omitempty"` - DurationLeft uint64 `protobuf:"varint,7,opt,name=duration_left,json=durationLeft,proto3" json:"duration_left,omitempty"` - MonthExpiryTime uint64 `protobuf:"varint,8,opt,name=month_expiry_time,json=monthExpiryTime,proto3" json:"month_expiry_time,omitempty"` - PrevExpiryBlock uint64 `protobuf:"varint,9,opt,name=prev_expiry_block,json=prevExpiryBlock,proto3" json:"prev_expiry_block,omitempty"` - MonthCuTotal uint64 `protobuf:"varint,10,opt,name=month_cu_total,json=monthCuTotal,proto3" json:"month_cu_total,omitempty"` - MonthCuLeft uint64 `protobuf:"varint,11,opt,name=month_cu_left,json=monthCuLeft,proto3" json:"month_cu_left,omitempty"` - PrevCuLeft uint64 `protobuf:"varint,12,opt,name=prev_cu_left,json=prevCuLeft,proto3" json:"prev_cu_left,omitempty"` -} - -func (m *Subscription) Reset() { *m = Subscription{} } -func (m *Subscription) String() string { return proto.CompactTextString(m) } -func (*Subscription) ProtoMessage() {} -func (*Subscription) Descriptor() ([]byte, []int) { - return fileDescriptor_ac47bc0f89224537, []int{0} -} -func (m *Subscription) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Subscription) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Subscription.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 *Subscription) XXX_Merge(src proto.Message) { - xxx_messageInfo_Subscription.Merge(m, src) -} -func (m *Subscription) XXX_Size() int { - return m.Size() -} -func (m *Subscription) XXX_DiscardUnknown() { - xxx_messageInfo_Subscription.DiscardUnknown(m) -} - -var xxx_messageInfo_Subscription proto.InternalMessageInfo - -func (m *Subscription) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *Subscription) GetConsumer() string { - if m != nil { - return m.Consumer - } - return "" -} - -func (m *Subscription) GetBlock() uint64 { - if m != nil { - return m.Block - } - return 0 -} - -func (m *Subscription) GetPlanIndex() string { - if m != nil { - return m.PlanIndex - } - return "" -} - -func (m *Subscription) GetPlanBlock() uint64 { - if m != nil { - return m.PlanBlock - } - return 0 -} - -func (m *Subscription) GetDurationTotal() uint64 { - if m != nil { - return m.DurationTotal - } - return 0 -} - -func (m *Subscription) GetDurationLeft() uint64 { - if m != nil { - return m.DurationLeft - } - return 0 -} - -func (m *Subscription) GetMonthExpiryTime() uint64 { - if m != nil { - return m.MonthExpiryTime - } - return 0 -} - -func (m *Subscription) GetPrevExpiryBlock() uint64 { - if m != nil { - return m.PrevExpiryBlock - } - return 0 -} - -func (m *Subscription) GetMonthCuTotal() uint64 { - if m != nil { - return m.MonthCuTotal - } - return 0 -} - -func (m *Subscription) GetMonthCuLeft() uint64 { - if m != nil { - return m.MonthCuLeft - } - return 0 -} - -func (m *Subscription) GetPrevCuLeft() uint64 { - if m != nil { - return m.PrevCuLeft - } - return 0 -} - -func init() { - proto.RegisterType((*Subscription)(nil), "lavanet.lava.subscription.Subscription_V2") -} - -func init() { proto.RegisterFile("subscription/subscription.proto", fileDescriptor_ac47bc0f89224537) } - -var fileDescriptor_ac47bc0f89224537 = []byte{ - // 353 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x92, 0xcf, 0x4a, 0xeb, 0x40, - 0x14, 0xc6, 0x9b, 0xdb, 0xff, 0xa7, 0x69, 0x2f, 0x77, 0xb8, 0x8b, 0x51, 0x30, 0x96, 0xaa, 0x50, - 0x44, 0x92, 0x85, 0x6f, 0x50, 0x51, 0x10, 0x5c, 0xd5, 0xae, 0xdc, 0x84, 0x24, 0x9d, 0xda, 0xc1, - 0x24, 0x13, 0x26, 0x93, 0xd2, 0xbe, 0x85, 0x8f, 0xe1, 0xa3, 0xb8, 0xec, 0xd2, 0xa5, 0xb4, 0x2f, - 0x22, 0x73, 0xa6, 0x09, 0x75, 0x35, 0x9c, 0xdf, 0xf7, 0x3b, 0x99, 0x0f, 0x32, 0x70, 0x9e, 0x17, - 0x61, 0x1e, 0x49, 0x9e, 0x29, 0x2e, 0x52, 0xef, 0x78, 0x70, 0x33, 0x29, 0x94, 0x20, 0x27, 0x71, - 0xb0, 0x0a, 0x52, 0xa6, 0x5c, 0x7d, 0xba, 0xc7, 0xc2, 0xe8, 0xa3, 0x0e, 0xf6, 0xf3, 0x11, 0x20, - 0x14, 0xda, 0x91, 0x64, 0x81, 0x12, 0x92, 0x5a, 0x43, 0x6b, 0xdc, 0x9d, 0x96, 0x23, 0x39, 0x85, - 0x4e, 0x24, 0xd2, 0xbc, 0x48, 0x98, 0xa4, 0x7f, 0x30, 0xaa, 0x66, 0xf2, 0x1f, 0x9a, 0x61, 0x2c, - 0xa2, 0x37, 0x5a, 0x1f, 0x5a, 0xe3, 0xc6, 0xd4, 0x0c, 0xe4, 0x0c, 0x20, 0x8b, 0x83, 0xd4, 0xe7, - 0xe9, 0x9c, 0xad, 0x69, 0x03, 0x77, 0xba, 0x9a, 0x3c, 0x6a, 0x50, 0xc5, 0x66, 0xb3, 0x89, 0x9b, - 0x18, 0x4f, 0x70, 0xfb, 0x0a, 0x06, 0xf3, 0x42, 0x06, 0xba, 0x95, 0xaf, 0x84, 0x0a, 0x62, 0xda, - 0x42, 0xa5, 0x5f, 0xd2, 0x99, 0x86, 0xe4, 0x02, 0x2a, 0xe0, 0xc7, 0x6c, 0xa1, 0x68, 0x1b, 0x2d, - 0xbb, 0x84, 0x4f, 0x6c, 0xa1, 0xc8, 0x35, 0xfc, 0x4b, 0x44, 0xaa, 0x96, 0x3e, 0x5b, 0x67, 0x5c, - 0x6e, 0x7c, 0xc5, 0x13, 0x46, 0x3b, 0x28, 0xfe, 0xc5, 0xe0, 0x1e, 0xf9, 0x8c, 0x27, 0x4c, 0xbb, - 0x99, 0x64, 0xab, 0x52, 0x35, 0xed, 0xba, 0xc6, 0xd5, 0x81, 0x51, 0x4d, 0xc7, 0x4b, 0x18, 0x98, - 0xef, 0x46, 0xc5, 0xa1, 0x23, 0x98, 0xdb, 0x91, 0xde, 0x15, 0xa6, 0xe2, 0x08, 0xfa, 0x95, 0x85, - 0x15, 0x7b, 0x28, 0xf5, 0x0e, 0x12, 0x36, 0x1c, 0x82, 0x8d, 0xb7, 0x96, 0x8a, 0x8d, 0x0a, 0x68, - 0x66, 0x8c, 0xc9, 0xc3, 0xe7, 0xce, 0xb1, 0xb6, 0x3b, 0xc7, 0xfa, 0xde, 0x39, 0xd6, 0xfb, 0xde, - 0xa9, 0x6d, 0xf7, 0x4e, 0xed, 0x6b, 0xef, 0xd4, 0x5e, 0x6e, 0x5e, 0xb9, 0x5a, 0x16, 0xa1, 0x1b, - 0x89, 0xc4, 0x3b, 0xfc, 0x6a, 0x3c, 0xbd, 0xf5, 0xaf, 0xd7, 0xe0, 0xa9, 0x4d, 0xc6, 0xf2, 0xb0, - 0x85, 0x8f, 0xe2, 0xf6, 0x27, 0x00, 0x00, 0xff, 0xff, 0xd7, 0x6e, 0x85, 0xd9, 0x37, 0x02, 0x00, - 0x00, -} - -func (m *Subscription) 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 *Subscription) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Subscription) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.PrevCuLeft != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.PrevCuLeft)) - i-- - dAtA[i] = 0x60 - } - if m.MonthCuLeft != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.MonthCuLeft)) - i-- - dAtA[i] = 0x58 - } - if m.MonthCuTotal != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.MonthCuTotal)) - i-- - dAtA[i] = 0x50 - } - if m.PrevExpiryBlock != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.PrevExpiryBlock)) - i-- - dAtA[i] = 0x48 - } - if m.MonthExpiryTime != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.MonthExpiryTime)) - i-- - dAtA[i] = 0x40 - } - if m.DurationLeft != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.DurationLeft)) - i-- - dAtA[i] = 0x38 - } - if m.DurationTotal != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.DurationTotal)) - i-- - dAtA[i] = 0x30 - } - if m.PlanBlock != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.PlanBlock)) - i-- - dAtA[i] = 0x28 - } - if len(m.PlanIndex) > 0 { - i -= len(m.PlanIndex) - copy(dAtA[i:], m.PlanIndex) - i = encodeVarintSubscription(dAtA, i, uint64(len(m.PlanIndex))) - i-- - dAtA[i] = 0x22 - } - if m.Block != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.Block)) - i-- - dAtA[i] = 0x18 - } - if len(m.Consumer) > 0 { - i -= len(m.Consumer) - copy(dAtA[i:], m.Consumer) - i = encodeVarintSubscription(dAtA, i, uint64(len(m.Consumer))) - i-- - dAtA[i] = 0x12 - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintSubscription(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintSubscription(dAtA []byte, offset int, v uint64) int { - offset -= sovSubscription(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Subscription) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovSubscription(uint64(l)) - } - l = len(m.Consumer) - if l > 0 { - n += 1 + l + sovSubscription(uint64(l)) - } - if m.Block != 0 { - n += 1 + sovSubscription(uint64(m.Block)) - } - l = len(m.PlanIndex) - if l > 0 { - n += 1 + l + sovSubscription(uint64(l)) - } - if m.PlanBlock != 0 { - n += 1 + sovSubscription(uint64(m.PlanBlock)) - } - if m.DurationTotal != 0 { - n += 1 + sovSubscription(uint64(m.DurationTotal)) - } - if m.DurationLeft != 0 { - n += 1 + sovSubscription(uint64(m.DurationLeft)) - } - if m.MonthExpiryTime != 0 { - n += 1 + sovSubscription(uint64(m.MonthExpiryTime)) - } - if m.PrevExpiryBlock != 0 { - n += 1 + sovSubscription(uint64(m.PrevExpiryBlock)) - } - if m.MonthCuTotal != 0 { - n += 1 + sovSubscription(uint64(m.MonthCuTotal)) - } - if m.MonthCuLeft != 0 { - n += 1 + sovSubscription(uint64(m.MonthCuLeft)) - } - if m.PrevCuLeft != 0 { - n += 1 + sovSubscription(uint64(m.PrevCuLeft)) - } - return n -} - -func sovSubscription(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozSubscription(x uint64) (n int) { - return sovSubscription(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Subscription) 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 ErrIntOverflowSubscription - } - 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: Subscription: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Subscription: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSubscription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Consumer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSubscription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Consumer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) - } - m.Block = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Block |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PlanIndex", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSubscription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PlanIndex = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PlanBlock", wireType) - } - m.PlanBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PlanBlock |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DurationTotal", wireType) - } - m.DurationTotal = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DurationTotal |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DurationLeft", wireType) - } - m.DurationLeft = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DurationLeft |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MonthExpiryTime", wireType) - } - m.MonthExpiryTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MonthExpiryTime |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevExpiryBlock", wireType) - } - m.PrevExpiryBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PrevExpiryBlock |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MonthCuTotal", wireType) - } - m.MonthCuTotal = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MonthCuTotal |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MonthCuLeft", wireType) - } - m.MonthCuLeft = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MonthCuLeft |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevCuLeft", wireType) - } - m.PrevCuLeft = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PrevCuLeft |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSubscription(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSubscription - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipSubscription(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSubscription - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSubscription - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSubscription - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthSubscription - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupSubscription - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthSubscription - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthSubscription = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSubscription = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupSubscription = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/subscription/migrations/v5/cluster.go b/x/subscription/migrations/v5/cluster.go deleted file mode 100644 index 2af2fd59d4..0000000000 --- a/x/subscription/migrations/v5/cluster.go +++ /dev/null @@ -1,44 +0,0 @@ -package v5 - -// QoS clustering divides the QoS monitoring into a discrete set of clusters -// such that QoS is maintained separately for each Provider x Cluster. -// -// The clusters are determined based on certain subscription owner properties, -// such as past or recent activity (e.g. aggregate subscription periods), the -// current plan used, etc. Each consumer (subscription owner or project developer) -// QoS report about some provider will be considered only in the cluster matching -// that consumer’s properties. During pairing selection for a particular consumer, -// the QoS data for the pairing calculation will be taken from the cluster matching -// that consumer’s properties. -// Cluster assignment is updated when a subscription renews (every month). - -// To add a new cluster criterion, update the Cluster struct, create an array with -// the criterion values (like PLAN_CRITERION) and add it to ConstructAllClusters() -// -// All clusters: -// 1. For each plan (except "free") a cluster for each subUsage -// 2. "free" cluster (without regarding subUsage) - -import "strconv" - -const FREE_PLAN = "free" // gets its own const because it's treated differently - -func GetSubUsageCriterion(sub Subscription) uint64 { - switch { - case sub.DurationTotal == 0: - return 0 - case sub.DurationTotal > 6: - return 7 - default: - return 6 - } -} - -// GetClusterKey returns the subscription's best-fit cluster -func GetClusterKey(sub Subscription) string { - if sub.PlanIndex == FREE_PLAN { - return FREE_PLAN - } - - return sub.PlanIndex + "_" + strconv.FormatUint(GetSubUsageCriterion(sub), 10) -} diff --git a/x/subscription/migrations/v5/keys.go b/x/subscription/migrations/v5/keys.go deleted file mode 100644 index fa1c4b93c9..0000000000 --- a/x/subscription/migrations/v5/keys.go +++ /dev/null @@ -1,24 +0,0 @@ -package v5 - -const ( - // ModuleName defines the module name - ModuleName = "subscription" - - // StoreKey defines the primary module store key - StoreKey = ModuleName - - // RouterKey is the message route for slashing - RouterKey = ModuleName - - // QuerierRoute defines the module's query routing key - QuerierRoute = ModuleName - - // MemStoreKey defines the in-memory store key - MemStoreKey = "mem_subscription" - - // prefix for the subscription fixation store - SubsFixationPrefix = "subs-fs" - - // prefix for the subscription fixation store - SubsTimerPrefix = "subs-ts" -) diff --git a/x/subscription/migrations/v5/params.go b/x/subscription/migrations/v5/params.go deleted file mode 100644 index 246e2a01a5..0000000000 --- a/x/subscription/migrations/v5/params.go +++ /dev/null @@ -1,39 +0,0 @@ -package v5 - -import ( - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "gopkg.in/yaml.v2" -) - -var _ paramtypes.ParamSet = (*Params)(nil) - -// ParamKeyTable the param key table for launch module -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) -} - -// NewParams creates a new Params instance -func NewParams() Params { - return Params{} -} - -// DefaultParams returns a default set of parameters -func DefaultParams() Params { - return NewParams() -} - -// ParamSetPairs get the params.ParamSet -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{} -} - -// Validate validates the set of params -func (p Params) Validate() error { - return nil -} - -// String implements the Stringer interface. -func (p Params) String() string { - out, _ := yaml.Marshal(p) - return string(out) -} diff --git a/x/subscription/migrations/v5/params.pb.go b/x/subscription/migrations/v5/params.pb.go deleted file mode 100644 index 7d2d1487b7..0000000000 --- a/x/subscription/migrations/v5/params.pb.go +++ /dev/null @@ -1,266 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: lavanet/lava/subscription/params.proto - -package v5 - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Params defines the parameters for the module. -type Params struct { -} - -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_8b1e38ca40b9ef74, []int{0} -} -func (m *Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) -} -func (m *Params) XXX_Size() int { - return m.Size() -} -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) -} - -var xxx_messageInfo_Params proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Params)(nil), "lavanet.lava.subscription.ParamsV5") -} - -func init() { - proto.RegisterFile("lavanet/lava/subscription/params.proto", fileDescriptor_8b1e38ca40b9ef74) -} - -var fileDescriptor_8b1e38ca40b9ef74 = []byte{ - // 154 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xcb, 0x49, 0x2c, 0x4b, - 0xcc, 0x4b, 0x2d, 0xd1, 0x07, 0xd1, 0xfa, 0xc5, 0xa5, 0x49, 0xc5, 0xc9, 0x45, 0x99, 0x05, 0x25, - 0x99, 0xf9, 0x79, 0xfa, 0x05, 0x89, 0x45, 0x89, 0xb9, 0xc5, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, - 0x42, 0x92, 0x50, 0x75, 0x7a, 0x20, 0x5a, 0x0f, 0x59, 0x9d, 0x94, 0x48, 0x7a, 0x7e, 0x7a, 0x3e, - 0x58, 0x95, 0x3e, 0x88, 0x05, 0xd1, 0xa0, 0xc4, 0xc7, 0xc5, 0x16, 0x00, 0x36, 0xc0, 0x8a, 0x65, - 0xc6, 0x02, 0x79, 0x06, 0x27, 0xb7, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, - 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, - 0xd2, 0x49, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x47, 0x71, 0x4d, 0x05, - 0xaa, 0x7b, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xc6, 0x1b, 0x03, 0x02, 0x00, 0x00, - 0xff, 0xff, 0x51, 0x13, 0xf7, 0x58, 0xb9, 0x00, 0x00, 0x00, -} - -func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintParams(dAtA []byte, offset int, v uint64) int { - offset -= sovParams(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovParams(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozParams(x uint64) (n int) { - return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Params) 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 ErrIntOverflowParams - } - 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: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipParams(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthParams - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupParams - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthParams - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/subscription/migrations/v5/query.pb.go b/x/subscription/migrations/v5/query.pb.go deleted file mode 100644 index 9ba62c4de3..0000000000 --- a/x/subscription/migrations/v5/query.pb.go +++ /dev/null @@ -1,2154 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: lavanet/lava/subscription/query.proto - -package v5 - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" - 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. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// QueryParamsRequest is request type for the Query/Params RPC method. -type QueryParamsRequest struct { -} - -func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } -func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryParamsRequest) ProtoMessage() {} -func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e870698c9d8ccc09, []int{0} -} -func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryParamsRequest.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 *QueryParamsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsRequest.Merge(m, src) -} -func (m *QueryParamsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo - -// QueryParamsResponse is response type for the Query/Params RPC method. -type QueryParamsResponse struct { - // params holds all the parameters of this module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` -} - -func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } -func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryParamsResponse) ProtoMessage() {} -func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e870698c9d8ccc09, []int{1} -} -func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryParamsResponse.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 *QueryParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsResponse.Merge(m, src) -} -func (m *QueryParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo - -func (m *QueryParamsResponse) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -type QueryCurrentRequest struct { - Consumer string `protobuf:"bytes,1,opt,name=consumer,proto3" json:"consumer,omitempty"` -} - -func (m *QueryCurrentRequest) Reset() { *m = QueryCurrentRequest{} } -func (m *QueryCurrentRequest) String() string { return proto.CompactTextString(m) } -func (*QueryCurrentRequest) ProtoMessage() {} -func (*QueryCurrentRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e870698c9d8ccc09, []int{2} -} -func (m *QueryCurrentRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryCurrentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryCurrentRequest.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 *QueryCurrentRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryCurrentRequest.Merge(m, src) -} -func (m *QueryCurrentRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryCurrentRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryCurrentRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryCurrentRequest proto.InternalMessageInfo - -func (m *QueryCurrentRequest) GetConsumer() string { - if m != nil { - return m.Consumer - } - return "" -} - -type QueryCurrentResponse struct { - Sub *Subscription `protobuf:"bytes,1,opt,name=sub,proto3" json:"sub,omitempty"` -} - -func (m *QueryCurrentResponse) Reset() { *m = QueryCurrentResponse{} } -func (m *QueryCurrentResponse) String() string { return proto.CompactTextString(m) } -func (*QueryCurrentResponse) ProtoMessage() {} -func (*QueryCurrentResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e870698c9d8ccc09, []int{3} -} -func (m *QueryCurrentResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryCurrentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryCurrentResponse.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 *QueryCurrentResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryCurrentResponse.Merge(m, src) -} -func (m *QueryCurrentResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryCurrentResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryCurrentResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryCurrentResponse proto.InternalMessageInfo - -func (m *QueryCurrentResponse) GetSub() *Subscription { - if m != nil { - return m.Sub - } - return nil -} - -type QueryListProjectsRequest struct { - Subscription string `protobuf:"bytes,1,opt,name=subscription,proto3" json:"subscription,omitempty"` -} - -func (m *QueryListProjectsRequest) Reset() { *m = QueryListProjectsRequest{} } -func (m *QueryListProjectsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryListProjectsRequest) ProtoMessage() {} -func (*QueryListProjectsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e870698c9d8ccc09, []int{4} -} -func (m *QueryListProjectsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryListProjectsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryListProjectsRequest.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 *QueryListProjectsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryListProjectsRequest.Merge(m, src) -} -func (m *QueryListProjectsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryListProjectsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryListProjectsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryListProjectsRequest proto.InternalMessageInfo - -func (m *QueryListProjectsRequest) GetSubscription() string { - if m != nil { - return m.Subscription - } - return "" -} - -type QueryListProjectsResponse struct { - Projects []string `protobuf:"bytes,1,rep,name=projects,proto3" json:"projects,omitempty"` -} - -func (m *QueryListProjectsResponse) Reset() { *m = QueryListProjectsResponse{} } -func (m *QueryListProjectsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryListProjectsResponse) ProtoMessage() {} -func (*QueryListProjectsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e870698c9d8ccc09, []int{5} -} -func (m *QueryListProjectsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryListProjectsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryListProjectsResponse.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 *QueryListProjectsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryListProjectsResponse.Merge(m, src) -} -func (m *QueryListProjectsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryListProjectsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryListProjectsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryListProjectsResponse proto.InternalMessageInfo - -func (m *QueryListProjectsResponse) GetProjects() []string { - if m != nil { - return m.Projects - } - return nil -} - -type QueryListRequest struct { -} - -func (m *QueryListRequest) Reset() { *m = QueryListRequest{} } -func (m *QueryListRequest) String() string { return proto.CompactTextString(m) } -func (*QueryListRequest) ProtoMessage() {} -func (*QueryListRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e870698c9d8ccc09, []int{6} -} -func (m *QueryListRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryListRequest.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 *QueryListRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryListRequest.Merge(m, src) -} -func (m *QueryListRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryListRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryListRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryListRequest proto.InternalMessageInfo - -type QueryListResponse struct { - SubsInfo []ListInfoStruct `protobuf:"bytes,1,rep,name=subs_info,json=subsInfo,proto3" json:"subs_info"` -} - -func (m *QueryListResponse) Reset() { *m = QueryListResponse{} } -func (m *QueryListResponse) String() string { return proto.CompactTextString(m) } -func (*QueryListResponse) ProtoMessage() {} -func (*QueryListResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e870698c9d8ccc09, []int{7} -} -func (m *QueryListResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryListResponse.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 *QueryListResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryListResponse.Merge(m, src) -} -func (m *QueryListResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryListResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryListResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryListResponse proto.InternalMessageInfo - -func (m *QueryListResponse) GetSubsInfo() []ListInfoStruct { - if m != nil { - return m.SubsInfo - } - return nil -} - -type ListInfoStruct struct { - Consumer string `protobuf:"bytes,1,opt,name=consumer,proto3" json:"consumer,omitempty"` - Plan string `protobuf:"bytes,2,opt,name=plan,proto3" json:"plan,omitempty"` - DurationBought uint64 `protobuf:"varint,3,opt,name=duration_bought,json=durationBought,proto3" json:"duration_bought,omitempty"` - DurationLeft uint64 `protobuf:"varint,4,opt,name=duration_left,json=durationLeft,proto3" json:"duration_left,omitempty"` - MonthExpiry uint64 `protobuf:"varint,5,opt,name=month_expiry,json=monthExpiry,proto3" json:"month_expiry,omitempty"` - MonthCuTotal uint64 `protobuf:"varint,6,opt,name=month_cu_total,json=monthCuTotal,proto3" json:"month_cu_total,omitempty"` - MonthCuLeft uint64 `protobuf:"varint,7,opt,name=month_cu_left,json=monthCuLeft,proto3" json:"month_cu_left,omitempty"` - Cluster string `protobuf:"bytes,8,opt,name=cluster,proto3" json:"cluster,omitempty"` - DurationTotal uint64 `protobuf:"varint,9,opt,name=duration_total,json=durationTotal,proto3" json:"duration_total,omitempty"` -} - -func (m *ListInfoStruct) Reset() { *m = ListInfoStruct{} } -func (m *ListInfoStruct) String() string { return proto.CompactTextString(m) } -func (*ListInfoStruct) ProtoMessage() {} -func (*ListInfoStruct) Descriptor() ([]byte, []int) { - return fileDescriptor_e870698c9d8ccc09, []int{8} -} -func (m *ListInfoStruct) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListInfoStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListInfoStruct.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 *ListInfoStruct) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListInfoStruct.Merge(m, src) -} -func (m *ListInfoStruct) XXX_Size() int { - return m.Size() -} -func (m *ListInfoStruct) XXX_DiscardUnknown() { - xxx_messageInfo_ListInfoStruct.DiscardUnknown(m) -} - -var xxx_messageInfo_ListInfoStruct proto.InternalMessageInfo - -func (m *ListInfoStruct) GetConsumer() string { - if m != nil { - return m.Consumer - } - return "" -} - -func (m *ListInfoStruct) GetPlan() string { - if m != nil { - return m.Plan - } - return "" -} - -func (m *ListInfoStruct) GetDurationBought() uint64 { - if m != nil { - return m.DurationBought - } - return 0 -} - -func (m *ListInfoStruct) GetDurationLeft() uint64 { - if m != nil { - return m.DurationLeft - } - return 0 -} - -func (m *ListInfoStruct) GetMonthExpiry() uint64 { - if m != nil { - return m.MonthExpiry - } - return 0 -} - -func (m *ListInfoStruct) GetMonthCuTotal() uint64 { - if m != nil { - return m.MonthCuTotal - } - return 0 -} - -func (m *ListInfoStruct) GetMonthCuLeft() uint64 { - if m != nil { - return m.MonthCuLeft - } - return 0 -} - -func (m *ListInfoStruct) GetCluster() string { - if m != nil { - return m.Cluster - } - return "" -} - -func (m *ListInfoStruct) GetDurationTotal() uint64 { - if m != nil { - return m.DurationTotal - } - return 0 -} - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "lavanet.lava.subscription.QueryParamsRequestV5") - proto.RegisterType((*QueryParamsResponse)(nil), "lavanet.lava.subscription.QueryParamsResponseV5") - proto.RegisterType((*QueryCurrentRequest)(nil), "lavanet.lava.subscription.QueryCurrentRequestV5") - proto.RegisterType((*QueryCurrentResponse)(nil), "lavanet.lava.subscription.QueryCurrentResponseV5") - proto.RegisterType((*QueryListProjectsRequest)(nil), "lavanet.lava.subscription.QueryListProjectsRequestV5") - proto.RegisterType((*QueryListProjectsResponse)(nil), "lavanet.lava.subscription.QueryListProjectsResponseV5") - proto.RegisterType((*QueryListRequest)(nil), "lavanet.lava.subscription.QueryListRequestV5") - proto.RegisterType((*QueryListResponse)(nil), "lavanet.lava.subscription.QueryListResponseV5") - proto.RegisterType((*ListInfoStruct)(nil), "lavanet.lava.subscription.ListInfoStructV5") -} - -func init() { - proto.RegisterFile("lavanet/lava/subscription/query.proto", fileDescriptor_e870698c9d8ccc09) -} - -var fileDescriptor_e870698c9d8ccc09 = []byte{ - // 705 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xcf, 0x4e, 0xd4, 0x40, - 0x18, 0xdf, 0xc2, 0xb2, 0x2c, 0x1f, 0x0b, 0xea, 0xc8, 0xa1, 0x6c, 0xcc, 0xc2, 0x16, 0x11, 0x50, - 0xe8, 0x04, 0xd0, 0x10, 0x2f, 0x92, 0x40, 0x34, 0x31, 0xe1, 0x80, 0x8b, 0xd1, 0xc4, 0xcb, 0xa6, - 0xad, 0xb3, 0xa5, 0xa6, 0xdb, 0x29, 0x9d, 0x19, 0x02, 0x21, 0x5c, 0x3c, 0x72, 0x32, 0xfa, 0x04, - 0xbe, 0x86, 0xf1, 0x01, 0x38, 0x92, 0x78, 0xf1, 0x64, 0x0c, 0xf8, 0x20, 0xa6, 0xd3, 0x69, 0xd3, - 0x46, 0xd8, 0x5d, 0x4f, 0xdb, 0xf9, 0xf5, 0xf7, 0x6f, 0xa6, 0xf3, 0x65, 0x61, 0xde, 0xb7, 0x0e, - 0xad, 0x80, 0x70, 0x1c, 0xff, 0x62, 0x26, 0x6c, 0xe6, 0x44, 0x5e, 0xc8, 0x3d, 0x1a, 0xe0, 0x03, - 0x41, 0xa2, 0x63, 0x33, 0x8c, 0x28, 0xa7, 0x68, 0x5a, 0xd1, 0xcc, 0xf8, 0xd7, 0xcc, 0xd3, 0xea, - 0x53, 0x2e, 0x75, 0xa9, 0x64, 0xe1, 0xf8, 0x29, 0x11, 0xd4, 0xef, 0xb9, 0x94, 0xba, 0x3e, 0xc1, - 0x56, 0xe8, 0x61, 0x2b, 0x08, 0x28, 0xb7, 0x62, 0x32, 0x53, 0x6f, 0x1f, 0x3a, 0x94, 0x75, 0x29, - 0xc3, 0xb6, 0xc5, 0x48, 0x92, 0x83, 0x0f, 0x57, 0x6d, 0xc2, 0xad, 0x55, 0x1c, 0x5a, 0xae, 0x17, - 0x48, 0xb2, 0xe2, 0x3e, 0xb8, 0xb9, 0x61, 0x68, 0x45, 0x56, 0x37, 0xf5, 0x5c, 0xbe, 0x99, 0x97, - 0x5f, 0x24, 0x6c, 0x63, 0x0a, 0xd0, 0xab, 0x38, 0x77, 0x57, 0x5a, 0xb4, 0xc8, 0x81, 0x20, 0x8c, - 0x1b, 0x6f, 0xe0, 0x6e, 0x01, 0x65, 0x21, 0x0d, 0x18, 0x41, 0x9b, 0x50, 0x49, 0xa2, 0x74, 0x6d, - 0x56, 0x5b, 0x1c, 0x5f, 0x6b, 0x9a, 0x37, 0x1e, 0x87, 0x99, 0x48, 0xb7, 0xca, 0xe7, 0xbf, 0x66, - 0x4a, 0x2d, 0x25, 0x33, 0x56, 0x95, 0xef, 0xb6, 0x88, 0x22, 0x12, 0x70, 0x15, 0x87, 0xea, 0x50, - 0x75, 0x68, 0xc0, 0x44, 0x97, 0x44, 0xd2, 0x79, 0xac, 0x95, 0xad, 0x8d, 0xb7, 0x30, 0x55, 0x94, - 0x64, 0x5d, 0x86, 0x99, 0xb0, 0x55, 0x91, 0x85, 0x1e, 0x45, 0xf6, 0x72, 0x0b, 0x59, 0x47, 0x6b, - 0xc5, 0x4a, 0xe3, 0x19, 0xe8, 0xd2, 0x78, 0xc7, 0x63, 0x7c, 0x37, 0xa2, 0x1f, 0x88, 0xc3, 0xd3, - 0xfd, 0x23, 0x03, 0x6a, 0x79, 0x0f, 0x55, 0xaa, 0x80, 0x19, 0x1b, 0x30, 0x7d, 0x8d, 0x5e, 0xb5, - 0xab, 0x43, 0x35, 0x54, 0x98, 0xae, 0xcd, 0x0e, 0xc7, 0x3b, 0x4a, 0xd7, 0x06, 0x82, 0xdb, 0x99, - 0x30, 0x3d, 0x70, 0x0b, 0xee, 0xe4, 0x30, 0x65, 0xb2, 0x03, 0x63, 0x71, 0x62, 0xdb, 0x0b, 0x3a, - 0x54, 0xba, 0x8c, 0xaf, 0x2d, 0xf5, 0xd8, 0x68, 0xac, 0x7d, 0x19, 0x74, 0xe8, 0x1e, 0x8f, 0x84, - 0xc3, 0xd5, 0xc9, 0x57, 0x63, 0x4a, 0x8c, 0x1a, 0xdf, 0x87, 0x60, 0xb2, 0x48, 0xe9, 0x75, 0xee, - 0x08, 0x41, 0x39, 0xf4, 0xad, 0x40, 0x1f, 0x92, 0xb8, 0x7c, 0x46, 0x0b, 0x70, 0xeb, 0xbd, 0x88, - 0xe4, 0xa5, 0x6c, 0xdb, 0x54, 0xb8, 0xfb, 0x5c, 0x1f, 0x9e, 0xd5, 0x16, 0xcb, 0xad, 0xc9, 0x14, - 0xde, 0x92, 0x28, 0x9a, 0x83, 0x89, 0x8c, 0xe8, 0x93, 0x0e, 0xd7, 0xcb, 0x92, 0x56, 0x4b, 0xc1, - 0x1d, 0xd2, 0xe1, 0xa8, 0x09, 0xb5, 0x2e, 0x0d, 0xf8, 0x7e, 0x9b, 0x1c, 0x85, 0x5e, 0x74, 0xac, - 0x8f, 0x48, 0xce, 0xb8, 0xc4, 0x9e, 0x4b, 0x08, 0xdd, 0x87, 0xc9, 0x84, 0xe2, 0x88, 0x36, 0xa7, - 0xdc, 0xf2, 0xf5, 0x4a, 0x62, 0x24, 0xd1, 0x6d, 0xf1, 0x3a, 0xc6, 0x90, 0x01, 0x13, 0x19, 0x4b, - 0xa6, 0x8d, 0xe6, 0x9c, 0xb6, 0x85, 0x0c, 0xd3, 0x61, 0xd4, 0xf1, 0x05, 0xe3, 0x24, 0xd2, 0xab, - 0x72, 0x47, 0xe9, 0x12, 0xcd, 0x43, 0xd6, 0x5e, 0x65, 0x8c, 0x49, 0x79, 0xb6, 0x03, 0x19, 0xb2, - 0x76, 0x36, 0x02, 0x23, 0xf2, 0x13, 0xa1, 0xcf, 0x1a, 0x54, 0x92, 0xdb, 0x8d, 0x56, 0x7a, 0x7c, - 0x8e, 0x7f, 0xc7, 0xaa, 0x6e, 0x0e, 0x4a, 0x4f, 0x2e, 0x80, 0xb1, 0xf4, 0xf1, 0xc7, 0x9f, 0x2f, - 0x43, 0x73, 0xa8, 0x89, 0xfb, 0xcd, 0x3e, 0xfa, 0xaa, 0xc1, 0xa8, 0x1a, 0x11, 0xd4, 0x37, 0xa6, - 0x38, 0x7e, 0x75, 0x3c, 0x30, 0x5f, 0xf5, 0x7a, 0x22, 0x7b, 0x61, 0xb4, 0xd2, 0xa3, 0x97, 0x93, - 0x68, 0xf0, 0x49, 0x7a, 0xa3, 0x4e, 0xd1, 0x37, 0x0d, 0x6a, 0xf9, 0x69, 0x41, 0xeb, 0xfd, 0x82, - 0xaf, 0x99, 0xcd, 0xfa, 0xe3, 0xff, 0x13, 0xa9, 0xca, 0x9b, 0xb2, 0xf2, 0x53, 0xb4, 0xd1, 0xa3, - 0xb2, 0xef, 0x31, 0xde, 0x4e, 0xc7, 0x14, 0x9f, 0xe4, 0xdf, 0x9d, 0xa2, 0x33, 0x0d, 0xca, 0xb1, - 0x33, 0x7a, 0x34, 0x48, 0x7e, 0x5a, 0x76, 0x79, 0x30, 0xb2, 0x2a, 0xb9, 0x20, 0x4b, 0x36, 0xd1, - 0x4c, 0x9f, 0x92, 0x5b, 0x2f, 0xce, 0x2f, 0x1b, 0xda, 0xc5, 0x65, 0x43, 0xfb, 0x7d, 0xd9, 0xd0, - 0x3e, 0x5d, 0x35, 0x4a, 0x17, 0x57, 0x8d, 0xd2, 0xcf, 0xab, 0x46, 0xe9, 0xdd, 0xb2, 0xeb, 0xf1, - 0x7d, 0x61, 0x9b, 0x0e, 0xed, 0x16, 0x4d, 0x8e, 0x8a, 0x36, 0xfc, 0x38, 0x24, 0xcc, 0xae, 0xc8, - 0x3f, 0x81, 0xf5, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x59, 0xba, 0xfa, 0x52, 0xfe, 0x06, 0x00, - 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// QueryClient is the client API for Query service. -// -// 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 { - // Parameters queries the parameters of the module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Queries a list of Current items. - Current(ctx context.Context, in *QueryCurrentRequest, opts ...grpc.CallOption) (*QueryCurrentResponse, error) - // Queries a list of ListProjects items. - ListProjects(ctx context.Context, in *QueryListProjectsRequest, opts ...grpc.CallOption) (*QueryListProjectsResponse, error) - // Queries a list of List items. - List(ctx context.Context, in *QueryListRequest, opts ...grpc.CallOption) (*QueryListResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/lavanet.lava.subscription.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Current(ctx context.Context, in *QueryCurrentRequest, opts ...grpc.CallOption) (*QueryCurrentResponse, error) { - out := new(QueryCurrentResponse) - err := c.cc.Invoke(ctx, "/lavanet.lava.subscription.Query/Current", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) ListProjects(ctx context.Context, in *QueryListProjectsRequest, opts ...grpc.CallOption) (*QueryListProjectsResponse, error) { - out := new(QueryListProjectsResponse) - err := c.cc.Invoke(ctx, "/lavanet.lava.subscription.Query/ListProjects", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) List(ctx context.Context, in *QueryListRequest, opts ...grpc.CallOption) (*QueryListResponse, error) { - out := new(QueryListResponse) - err := c.cc.Invoke(ctx, "/lavanet.lava.subscription.Query/List", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // Parameters queries the parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Queries a list of Current items. - Current(context.Context, *QueryCurrentRequest) (*QueryCurrentResponse, error) - // Queries a list of ListProjects items. - ListProjects(context.Context, *QueryListProjectsRequest) (*QueryListProjectsResponse, error) - // Queries a list of List items. - List(context.Context, *QueryListRequest) (*QueryListResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} -func (*UnimplementedQueryServer) Current(ctx context.Context, req *QueryCurrentRequest) (*QueryCurrentResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Current not implemented") -} -func (*UnimplementedQueryServer) ListProjects(ctx context.Context, req *QueryListProjectsRequest) (*QueryListProjectsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListProjects not implemented") -} -func (*UnimplementedQueryServer) List(ctx context.Context, req *QueryListRequest) (*QueryListResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method List not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryParamsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Params(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lavanet.lava.subscription.Query/Params", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Current_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryCurrentRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Current(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lavanet.lava.subscription.Query/Current", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Current(ctx, req.(*QueryCurrentRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_ListProjects_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryListProjectsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).ListProjects(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lavanet.lava.subscription.Query/ListProjects", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ListProjects(ctx, req.(*QueryListProjectsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryListRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).List(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lavanet.lava.subscription.Query/List", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).List(ctx, req.(*QueryListRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "lavanet.lava.subscription.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "Current", - Handler: _Query_Current_Handler, - }, - { - MethodName: "ListProjects", - Handler: _Query_ListProjects_Handler, - }, - { - MethodName: "List", - Handler: _Query_List_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "lavanet/lava/subscription/query.proto", -} - -func (m *QueryParamsRequest) 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 *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryParamsResponse) 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 *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *QueryCurrentRequest) 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 *QueryCurrentRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryCurrentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Consumer) > 0 { - i -= len(m.Consumer) - copy(dAtA[i:], m.Consumer) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Consumer))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryCurrentResponse) 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 *QueryCurrentResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryCurrentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sub != nil { - { - size, err := m.Sub.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryListProjectsRequest) 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 *QueryListProjectsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryListProjectsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Subscription) > 0 { - i -= len(m.Subscription) - copy(dAtA[i:], m.Subscription) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Subscription))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryListProjectsResponse) 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 *QueryListProjectsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryListProjectsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Projects) > 0 { - for iNdEx := len(m.Projects) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Projects[iNdEx]) - copy(dAtA[i:], m.Projects[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Projects[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryListRequest) 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 *QueryListRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryListRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryListResponse) 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 *QueryListResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryListResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SubsInfo) > 0 { - for iNdEx := len(m.SubsInfo) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.SubsInfo[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ListInfoStruct) 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 *ListInfoStruct) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListInfoStruct) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.DurationTotal != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.DurationTotal)) - i-- - dAtA[i] = 0x48 - } - if len(m.Cluster) > 0 { - i -= len(m.Cluster) - copy(dAtA[i:], m.Cluster) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Cluster))) - i-- - dAtA[i] = 0x42 - } - if m.MonthCuLeft != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.MonthCuLeft)) - i-- - dAtA[i] = 0x38 - } - if m.MonthCuTotal != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.MonthCuTotal)) - i-- - dAtA[i] = 0x30 - } - if m.MonthExpiry != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.MonthExpiry)) - i-- - dAtA[i] = 0x28 - } - if m.DurationLeft != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.DurationLeft)) - i-- - dAtA[i] = 0x20 - } - if m.DurationBought != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.DurationBought)) - i-- - dAtA[i] = 0x18 - } - if len(m.Plan) > 0 { - i -= len(m.Plan) - copy(dAtA[i:], m.Plan) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Plan))) - i-- - dAtA[i] = 0x12 - } - if len(m.Consumer) > 0 { - i -= len(m.Consumer) - copy(dAtA[i:], m.Consumer) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Consumer))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryCurrentRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Consumer) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryCurrentResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sub != nil { - l = m.Sub.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryListProjectsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Subscription) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryListProjectsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Projects) > 0 { - for _, s := range m.Projects { - l = len(s) - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryListRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryListResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.SubsInfo) > 0 { - for _, e := range m.SubsInfo { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *ListInfoStruct) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Consumer) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Plan) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.DurationBought != 0 { - n += 1 + sovQuery(uint64(m.DurationBought)) - } - if m.DurationLeft != 0 { - n += 1 + sovQuery(uint64(m.DurationLeft)) - } - if m.MonthExpiry != 0 { - n += 1 + sovQuery(uint64(m.MonthExpiry)) - } - if m.MonthCuTotal != 0 { - n += 1 + sovQuery(uint64(m.MonthCuTotal)) - } - if m.MonthCuLeft != 0 { - n += 1 + sovQuery(uint64(m.MonthCuLeft)) - } - l = len(m.Cluster) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.DurationTotal != 0 { - n += 1 + sovQuery(uint64(m.DurationTotal)) - } - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *QueryParamsRequest) 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: QueryParamsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: 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 *QueryParamsResponse) 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: QueryParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryCurrentRequest) 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: QueryCurrentRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryCurrentRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Consumer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Consumer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryCurrentResponse) 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: QueryCurrentResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryCurrentResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sub", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Sub == nil { - m.Sub = &Subscription{} - } - if err := m.Sub.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryListProjectsRequest) 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: QueryListProjectsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryListProjectsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subscription", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Subscription = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryListProjectsResponse) 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: QueryListProjectsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryListProjectsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Projects", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Projects = append(m.Projects, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryListRequest) 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: QueryListRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryListRequest: 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 *QueryListResponse) 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: QueryListResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryListResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SubsInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SubsInfo = append(m.SubsInfo, ListInfoStruct{}) - if err := m.SubsInfo[len(m.SubsInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListInfoStruct) 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: ListInfoStruct: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListInfoStruct: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Consumer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Consumer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Plan", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Plan = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DurationBought", wireType) - } - m.DurationBought = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DurationBought |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DurationLeft", wireType) - } - m.DurationLeft = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DurationLeft |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MonthExpiry", wireType) - } - m.MonthExpiry = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MonthExpiry |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MonthCuTotal", wireType) - } - m.MonthCuTotal = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MonthCuTotal |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MonthCuLeft", wireType) - } - m.MonthCuLeft = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MonthCuLeft |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cluster", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Cluster = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DurationTotal", wireType) - } - m.DurationTotal = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DurationTotal |= 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 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthQuery - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupQuery - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/subscription/migrations/v5/subscription.pb.go b/x/subscription/migrations/v5/subscription.pb.go deleted file mode 100644 index aa00293c60..0000000000 --- a/x/subscription/migrations/v5/subscription.pb.go +++ /dev/null @@ -1,763 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: lavanet/lava/subscription/subscription.proto - -package v5 - -import ( - fmt "fmt" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Subscription struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - Consumer string `protobuf:"bytes,2,opt,name=consumer,proto3" json:"consumer,omitempty"` - Block uint64 `protobuf:"varint,3,opt,name=block,proto3" json:"block,omitempty"` - PlanIndex string `protobuf:"bytes,4,opt,name=plan_index,json=planIndex,proto3" json:"plan_index,omitempty"` - PlanBlock uint64 `protobuf:"varint,5,opt,name=plan_block,json=planBlock,proto3" json:"plan_block,omitempty"` - DurationBought uint64 `protobuf:"varint,6,opt,name=duration_bought,json=durationBought,proto3" json:"duration_bought,omitempty"` - DurationLeft uint64 `protobuf:"varint,7,opt,name=duration_left,json=durationLeft,proto3" json:"duration_left,omitempty"` - MonthExpiryTime uint64 `protobuf:"varint,8,opt,name=month_expiry_time,json=monthExpiryTime,proto3" json:"month_expiry_time,omitempty"` - MonthCuTotal uint64 `protobuf:"varint,10,opt,name=month_cu_total,json=monthCuTotal,proto3" json:"month_cu_total,omitempty"` - MonthCuLeft uint64 `protobuf:"varint,11,opt,name=month_cu_left,json=monthCuLeft,proto3" json:"month_cu_left,omitempty"` - Cluster string `protobuf:"bytes,13,opt,name=cluster,proto3" json:"cluster,omitempty"` - DurationTotal uint64 `protobuf:"varint,14,opt,name=duration_total,json=durationTotal,proto3" json:"duration_total,omitempty"` -} - -func (m *Subscription) Reset() { *m = Subscription{} } -func (m *Subscription) String() string { return proto.CompactTextString(m) } -func (*Subscription) ProtoMessage() {} -func (*Subscription) Descriptor() ([]byte, []int) { - return fileDescriptor_c3bc5507ca237d79, []int{0} -} -func (m *Subscription) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Subscription) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Subscription.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 *Subscription) XXX_Merge(src proto.Message) { - xxx_messageInfo_Subscription.Merge(m, src) -} -func (m *Subscription) XXX_Size() int { - return m.Size() -} -func (m *Subscription) XXX_DiscardUnknown() { - xxx_messageInfo_Subscription.DiscardUnknown(m) -} - -var xxx_messageInfo_Subscription proto.InternalMessageInfo - -func (m *Subscription) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *Subscription) GetConsumer() string { - if m != nil { - return m.Consumer - } - return "" -} - -func (m *Subscription) GetBlock() uint64 { - if m != nil { - return m.Block - } - return 0 -} - -func (m *Subscription) GetPlanIndex() string { - if m != nil { - return m.PlanIndex - } - return "" -} - -func (m *Subscription) GetPlanBlock() uint64 { - if m != nil { - return m.PlanBlock - } - return 0 -} - -func (m *Subscription) GetDurationBought() uint64 { - if m != nil { - return m.DurationBought - } - return 0 -} - -func (m *Subscription) GetDurationLeft() uint64 { - if m != nil { - return m.DurationLeft - } - return 0 -} - -func (m *Subscription) GetMonthExpiryTime() uint64 { - if m != nil { - return m.MonthExpiryTime - } - return 0 -} - -func (m *Subscription) GetMonthCuTotal() uint64 { - if m != nil { - return m.MonthCuTotal - } - return 0 -} - -func (m *Subscription) GetMonthCuLeft() uint64 { - if m != nil { - return m.MonthCuLeft - } - return 0 -} - -func (m *Subscription) GetCluster() string { - if m != nil { - return m.Cluster - } - return "" -} - -func (m *Subscription) GetDurationTotal() uint64 { - if m != nil { - return m.DurationTotal - } - return 0 -} - -func init() { - proto.RegisterType((*Subscription)(nil), "lavanet.lava.subscription.SubscriptionV5") -} - -func init() { - proto.RegisterFile("lavanet/lava/subscription/subscription.proto", fileDescriptor_c3bc5507ca237d79) -} - -var fileDescriptor_c3bc5507ca237d79 = []byte{ - // 370 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x92, 0xc1, 0x6e, 0xaa, 0x40, - 0x14, 0x86, 0xe5, 0x8a, 0x8a, 0x47, 0x51, 0xef, 0xe4, 0x2e, 0xe6, 0xde, 0xe4, 0x12, 0x63, 0xdb, - 0xd4, 0x34, 0x06, 0x17, 0x7d, 0x03, 0x9b, 0x36, 0xa9, 0xe9, 0xca, 0xba, 0xea, 0x86, 0x00, 0x8e, - 0x4a, 0x0a, 0x0c, 0x19, 0x66, 0x1a, 0x7d, 0x8b, 0xbe, 0x46, 0xdf, 0xa4, 0x4b, 0x97, 0x5d, 0x36, - 0xfa, 0x22, 0x0d, 0x07, 0x24, 0xba, 0x9a, 0x9c, 0xef, 0x7c, 0x3f, 0x87, 0x99, 0x1c, 0x18, 0x85, - 0xee, 0x9b, 0x1b, 0x33, 0x39, 0xce, 0xce, 0x71, 0xaa, 0xbc, 0xd4, 0x17, 0x41, 0x22, 0x03, 0x1e, - 0x9f, 0x15, 0x76, 0x22, 0xb8, 0xe4, 0xe4, 0x6f, 0x61, 0xdb, 0xd9, 0x69, 0x9f, 0x0a, 0x83, 0x8f, - 0x2a, 0xb4, 0x9f, 0x4f, 0x00, 0xa1, 0xd0, 0xf0, 0x05, 0x73, 0x25, 0x17, 0x54, 0xeb, 0x6b, 0xc3, - 0xe6, 0xec, 0x58, 0x92, 0x7f, 0x60, 0xf8, 0x3c, 0x4e, 0x55, 0xc4, 0x04, 0xfd, 0x85, 0xad, 0xb2, - 0x26, 0x7f, 0xa0, 0xe6, 0x85, 0xdc, 0x7f, 0xa5, 0xd5, 0xbe, 0x36, 0xd4, 0x67, 0x79, 0x41, 0xfe, - 0x03, 0x24, 0xa1, 0x1b, 0x3b, 0x41, 0xbc, 0x60, 0x1b, 0xaa, 0x63, 0xa6, 0x99, 0x91, 0xc7, 0x0c, - 0x94, 0xed, 0x3c, 0x59, 0xc3, 0x24, 0xb6, 0x27, 0x98, 0xbe, 0x86, 0xee, 0x42, 0x09, 0x37, 0xfb, - 0x2b, 0xc7, 0xe3, 0x6a, 0xb5, 0x96, 0xb4, 0x8e, 0x4e, 0xe7, 0x88, 0x27, 0x48, 0xc9, 0x05, 0x98, - 0xa5, 0x18, 0xb2, 0xa5, 0xa4, 0x0d, 0xd4, 0xda, 0x47, 0xf8, 0xc4, 0x96, 0x92, 0xdc, 0xc0, 0xef, - 0x88, 0xc7, 0x72, 0xed, 0xb0, 0x4d, 0x12, 0x88, 0xad, 0x23, 0x83, 0x88, 0x51, 0x03, 0xc5, 0x2e, - 0x36, 0xee, 0x91, 0xcf, 0x83, 0x88, 0x91, 0x4b, 0xe8, 0xe4, 0xae, 0xaf, 0x1c, 0xc9, 0xa5, 0x1b, - 0x52, 0xc8, 0xbf, 0x88, 0xf4, 0x4e, 0xcd, 0x33, 0x46, 0x06, 0x60, 0x96, 0x16, 0x8e, 0x6d, 0xa1, - 0xd4, 0x2a, 0x24, 0x9c, 0x9a, 0xbd, 0x66, 0xa8, 0x52, 0xc9, 0x04, 0x35, 0x8b, 0xd7, 0xcc, 0x4b, - 0x72, 0x05, 0xe5, 0x35, 0x8a, 0x19, 0x1d, 0x8c, 0x97, 0x57, 0xc1, 0x21, 0x53, 0xdd, 0x68, 0xf6, - 0x60, 0xaa, 0x1b, 0xed, 0x9e, 0x39, 0x79, 0xf8, 0xdc, 0x5b, 0xda, 0x6e, 0x6f, 0x69, 0xdf, 0x7b, - 0x4b, 0x7b, 0x3f, 0x58, 0x95, 0xdd, 0xc1, 0xaa, 0x7c, 0x1d, 0xac, 0xca, 0xcb, 0x68, 0x15, 0xc8, - 0xb5, 0xf2, 0x6c, 0x9f, 0x47, 0xe3, 0xb3, 0xcd, 0xd8, 0x9c, 0xef, 0x86, 0xdc, 0x26, 0x2c, 0xf5, - 0xea, 0xb8, 0x15, 0xb7, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc2, 0x89, 0x0d, 0x30, 0x45, 0x02, - 0x00, 0x00, -} - -func (m *Subscription) 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 *Subscription) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Subscription) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.DurationTotal != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.DurationTotal)) - i-- - dAtA[i] = 0x70 - } - if len(m.Cluster) > 0 { - i -= len(m.Cluster) - copy(dAtA[i:], m.Cluster) - i = encodeVarintSubscription(dAtA, i, uint64(len(m.Cluster))) - i-- - dAtA[i] = 0x6a - } - if m.MonthCuLeft != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.MonthCuLeft)) - i-- - dAtA[i] = 0x58 - } - if m.MonthCuTotal != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.MonthCuTotal)) - i-- - dAtA[i] = 0x50 - } - if m.MonthExpiryTime != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.MonthExpiryTime)) - i-- - dAtA[i] = 0x40 - } - if m.DurationLeft != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.DurationLeft)) - i-- - dAtA[i] = 0x38 - } - if m.DurationBought != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.DurationBought)) - i-- - dAtA[i] = 0x30 - } - if m.PlanBlock != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.PlanBlock)) - i-- - dAtA[i] = 0x28 - } - if len(m.PlanIndex) > 0 { - i -= len(m.PlanIndex) - copy(dAtA[i:], m.PlanIndex) - i = encodeVarintSubscription(dAtA, i, uint64(len(m.PlanIndex))) - i-- - dAtA[i] = 0x22 - } - if m.Block != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.Block)) - i-- - dAtA[i] = 0x18 - } - if len(m.Consumer) > 0 { - i -= len(m.Consumer) - copy(dAtA[i:], m.Consumer) - i = encodeVarintSubscription(dAtA, i, uint64(len(m.Consumer))) - i-- - dAtA[i] = 0x12 - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintSubscription(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintSubscription(dAtA []byte, offset int, v uint64) int { - offset -= sovSubscription(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Subscription) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovSubscription(uint64(l)) - } - l = len(m.Consumer) - if l > 0 { - n += 1 + l + sovSubscription(uint64(l)) - } - if m.Block != 0 { - n += 1 + sovSubscription(uint64(m.Block)) - } - l = len(m.PlanIndex) - if l > 0 { - n += 1 + l + sovSubscription(uint64(l)) - } - if m.PlanBlock != 0 { - n += 1 + sovSubscription(uint64(m.PlanBlock)) - } - if m.DurationBought != 0 { - n += 1 + sovSubscription(uint64(m.DurationBought)) - } - if m.DurationLeft != 0 { - n += 1 + sovSubscription(uint64(m.DurationLeft)) - } - if m.MonthExpiryTime != 0 { - n += 1 + sovSubscription(uint64(m.MonthExpiryTime)) - } - if m.MonthCuTotal != 0 { - n += 1 + sovSubscription(uint64(m.MonthCuTotal)) - } - if m.MonthCuLeft != 0 { - n += 1 + sovSubscription(uint64(m.MonthCuLeft)) - } - l = len(m.Cluster) - if l > 0 { - n += 1 + l + sovSubscription(uint64(l)) - } - if m.DurationTotal != 0 { - n += 1 + sovSubscription(uint64(m.DurationTotal)) - } - return n -} - -func sovSubscription(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozSubscription(x uint64) (n int) { - return sovSubscription(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Subscription) 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 ErrIntOverflowSubscription - } - 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: Subscription: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Subscription: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSubscription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Consumer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSubscription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Consumer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) - } - m.Block = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Block |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PlanIndex", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSubscription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PlanIndex = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PlanBlock", wireType) - } - m.PlanBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PlanBlock |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DurationBought", wireType) - } - m.DurationBought = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DurationBought |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DurationLeft", wireType) - } - m.DurationLeft = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DurationLeft |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MonthExpiryTime", wireType) - } - m.MonthExpiryTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MonthExpiryTime |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MonthCuTotal", wireType) - } - m.MonthCuTotal = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MonthCuTotal |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MonthCuLeft", wireType) - } - m.MonthCuLeft = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MonthCuLeft |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cluster", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSubscription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Cluster = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DurationTotal", wireType) - } - m.DurationTotal = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DurationTotal |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSubscription(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSubscription - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipSubscription(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSubscription - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSubscription - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSubscription - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthSubscription - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupSubscription - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthSubscription - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthSubscription = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSubscription = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupSubscription = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/subscription/migrations/v6/subscription.pb.go b/x/subscription/migrations/v6/subscription.pb.go deleted file mode 100644 index 521214471f..0000000000 --- a/x/subscription/migrations/v6/subscription.pb.go +++ /dev/null @@ -1,1162 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: lavanet/lava/subscription/subscription.proto - -package v6 - -import ( - fmt "fmt" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Subscription struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - Consumer string `protobuf:"bytes,2,opt,name=consumer,proto3" json:"consumer,omitempty"` - Block uint64 `protobuf:"varint,3,opt,name=block,proto3" json:"block,omitempty"` - PlanIndex string `protobuf:"bytes,4,opt,name=plan_index,json=planIndex,proto3" json:"plan_index,omitempty"` - PlanBlock uint64 `protobuf:"varint,5,opt,name=plan_block,json=planBlock,proto3" json:"plan_block,omitempty"` - DurationBought uint64 `protobuf:"varint,6,opt,name=duration_bought,json=durationBought,proto3" json:"duration_bought,omitempty"` - DurationLeft uint64 `protobuf:"varint,7,opt,name=duration_left,json=durationLeft,proto3" json:"duration_left,omitempty"` - MonthExpiryTime uint64 `protobuf:"varint,8,opt,name=month_expiry_time,json=monthExpiryTime,proto3" json:"month_expiry_time,omitempty"` - MonthCuTotal uint64 `protobuf:"varint,10,opt,name=month_cu_total,json=monthCuTotal,proto3" json:"month_cu_total,omitempty"` - MonthCuLeft uint64 `protobuf:"varint,11,opt,name=month_cu_left,json=monthCuLeft,proto3" json:"month_cu_left,omitempty"` - Cluster string `protobuf:"bytes,13,opt,name=cluster,proto3" json:"cluster,omitempty"` - DurationTotal uint64 `protobuf:"varint,14,opt,name=duration_total,json=durationTotal,proto3" json:"duration_total,omitempty"` - AutoRenewal bool `protobuf:"varint,15,opt,name=auto_renewal,json=autoRenewal,proto3" json:"auto_renewal,omitempty"` - FutureSubscription *FutureSubscription `protobuf:"bytes,16,opt,name=future_subscription,json=futureSubscription,proto3" json:"future_subscription,omitempty"` -} - -func (m *Subscription) Reset() { *m = Subscription{} } -func (m *Subscription) String() string { return proto.CompactTextString(m) } -func (*Subscription) ProtoMessage() {} -func (*Subscription) Descriptor() ([]byte, []int) { - return fileDescriptor_c3bc5507ca237d79, []int{0} -} -func (m *Subscription) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Subscription) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Subscription.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 *Subscription) XXX_Merge(src proto.Message) { - xxx_messageInfo_Subscription.Merge(m, src) -} -func (m *Subscription) XXX_Size() int { - return m.Size() -} -func (m *Subscription) XXX_DiscardUnknown() { - xxx_messageInfo_Subscription.DiscardUnknown(m) -} - -var xxx_messageInfo_Subscription proto.InternalMessageInfo - -func (m *Subscription) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *Subscription) GetConsumer() string { - if m != nil { - return m.Consumer - } - return "" -} - -func (m *Subscription) GetBlock() uint64 { - if m != nil { - return m.Block - } - return 0 -} - -func (m *Subscription) GetPlanIndex() string { - if m != nil { - return m.PlanIndex - } - return "" -} - -func (m *Subscription) GetPlanBlock() uint64 { - if m != nil { - return m.PlanBlock - } - return 0 -} - -func (m *Subscription) GetDurationBought() uint64 { - if m != nil { - return m.DurationBought - } - return 0 -} - -func (m *Subscription) GetDurationLeft() uint64 { - if m != nil { - return m.DurationLeft - } - return 0 -} - -func (m *Subscription) GetMonthExpiryTime() uint64 { - if m != nil { - return m.MonthExpiryTime - } - return 0 -} - -func (m *Subscription) GetMonthCuTotal() uint64 { - if m != nil { - return m.MonthCuTotal - } - return 0 -} - -func (m *Subscription) GetMonthCuLeft() uint64 { - if m != nil { - return m.MonthCuLeft - } - return 0 -} - -func (m *Subscription) GetCluster() string { - if m != nil { - return m.Cluster - } - return "" -} - -func (m *Subscription) GetDurationTotal() uint64 { - if m != nil { - return m.DurationTotal - } - return 0 -} - -func (m *Subscription) GetAutoRenewal() bool { - if m != nil { - return m.AutoRenewal - } - return false -} - -func (m *Subscription) GetFutureSubscription() *FutureSubscription { - if m != nil { - return m.FutureSubscription - } - return nil -} - -type FutureSubscription struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - PlanIndex string `protobuf:"bytes,2,opt,name=plan_index,json=planIndex,proto3" json:"plan_index,omitempty"` - PlanBlock uint64 `protobuf:"varint,3,opt,name=plan_block,json=planBlock,proto3" json:"plan_block,omitempty"` - DurationBought uint64 `protobuf:"varint,4,opt,name=duration_bought,json=durationBought,proto3" json:"duration_bought,omitempty"` -} - -func (m *FutureSubscription) Reset() { *m = FutureSubscription{} } -func (m *FutureSubscription) String() string { return proto.CompactTextString(m) } -func (*FutureSubscription) ProtoMessage() {} -func (*FutureSubscription) Descriptor() ([]byte, []int) { - return fileDescriptor_c3bc5507ca237d79, []int{1} -} -func (m *FutureSubscription) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FutureSubscription) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_FutureSubscription.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 *FutureSubscription) XXX_Merge(src proto.Message) { - xxx_messageInfo_FutureSubscription.Merge(m, src) -} -func (m *FutureSubscription) XXX_Size() int { - return m.Size() -} -func (m *FutureSubscription) XXX_DiscardUnknown() { - xxx_messageInfo_FutureSubscription.DiscardUnknown(m) -} - -var xxx_messageInfo_FutureSubscription proto.InternalMessageInfo - -func (m *FutureSubscription) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *FutureSubscription) GetPlanIndex() string { - if m != nil { - return m.PlanIndex - } - return "" -} - -func (m *FutureSubscription) GetPlanBlock() uint64 { - if m != nil { - return m.PlanBlock - } - return 0 -} - -func (m *FutureSubscription) GetDurationBought() uint64 { - if m != nil { - return m.DurationBought - } - return 0 -} - -func init() { - proto.RegisterType((*Subscription)(nil), "lavanet.lava.subscription.SubscriptionV6") - proto.RegisterType((*FutureSubscription)(nil), "lavanet.lava.subscription.FutureSubscriptionV6") -} - -func init() { - proto.RegisterFile("lavanet/lava/subscription/subscription.proto", fileDescriptor_c3bc5507ca237d79) -} - -var fileDescriptor_c3bc5507ca237d79 = []byte{ - // 452 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xcf, 0x6e, 0xd3, 0x40, - 0x10, 0xc6, 0xb3, 0xad, 0xdb, 0x3a, 0x93, 0xbf, 0x2c, 0x1c, 0x16, 0x24, 0xac, 0x10, 0x40, 0x44, - 0xa8, 0x38, 0x12, 0xbc, 0x41, 0x10, 0x95, 0xa8, 0x38, 0x99, 0x9e, 0x38, 0x60, 0xd9, 0xee, 0xa6, - 0xb1, 0xb0, 0xbd, 0xd6, 0x7a, 0x16, 0xd2, 0xb7, 0xe0, 0xc2, 0x5b, 0xf0, 0x20, 0x1c, 0x7b, 0xe4, - 0x88, 0x92, 0x17, 0x41, 0x1e, 0x27, 0x56, 0xac, 0x42, 0xd4, 0xd3, 0x6a, 0x7e, 0xf3, 0x7d, 0x1e, - 0xef, 0xce, 0x0c, 0x9c, 0x26, 0xc1, 0xd7, 0x20, 0x93, 0x38, 0x2d, 0xcf, 0x69, 0x61, 0xc2, 0x22, - 0xd2, 0x71, 0x8e, 0xb1, 0xca, 0x1a, 0x81, 0x9b, 0x6b, 0x85, 0x8a, 0x3f, 0xdc, 0xa8, 0xdd, 0xf2, - 0x74, 0x77, 0x05, 0xe3, 0x9f, 0x16, 0x74, 0x3f, 0xee, 0x00, 0x2e, 0xe0, 0x24, 0xd2, 0x32, 0x40, - 0xa5, 0x05, 0x1b, 0xb1, 0x49, 0xdb, 0xdb, 0x86, 0xfc, 0x11, 0xd8, 0x91, 0xca, 0x0a, 0x93, 0x4a, - 0x2d, 0x0e, 0x28, 0x55, 0xc7, 0xfc, 0x01, 0x1c, 0x85, 0x89, 0x8a, 0xbe, 0x88, 0xc3, 0x11, 0x9b, - 0x58, 0x5e, 0x15, 0xf0, 0xc7, 0x00, 0x79, 0x12, 0x64, 0x7e, 0x9c, 0x5d, 0xca, 0xa5, 0xb0, 0xc8, - 0xd3, 0x2e, 0xc9, 0xfb, 0x12, 0xd4, 0xe9, 0xca, 0x79, 0x44, 0x4e, 0x4a, 0xcf, 0xc8, 0xfd, 0x02, - 0x06, 0x97, 0x46, 0x07, 0xe5, 0x5f, 0xf9, 0xa1, 0x32, 0x57, 0x0b, 0x14, 0xc7, 0xa4, 0xe9, 0x6f, - 0xf1, 0x8c, 0x28, 0x7f, 0x0a, 0xbd, 0x5a, 0x98, 0xc8, 0x39, 0x8a, 0x13, 0x92, 0x75, 0xb7, 0xf0, - 0x83, 0x9c, 0x23, 0x7f, 0x09, 0xf7, 0x52, 0x95, 0xe1, 0xc2, 0x97, 0xcb, 0x3c, 0xd6, 0xd7, 0x3e, - 0xc6, 0xa9, 0x14, 0x36, 0x09, 0x07, 0x94, 0x78, 0x47, 0xfc, 0x22, 0x4e, 0x25, 0x7f, 0x06, 0xfd, - 0x4a, 0x1b, 0x19, 0x1f, 0x15, 0x06, 0x89, 0x80, 0xea, 0x8b, 0x44, 0xdf, 0x9a, 0x8b, 0x92, 0xf1, - 0x31, 0xf4, 0x6a, 0x15, 0x95, 0xed, 0x90, 0xa8, 0xb3, 0x11, 0x51, 0xd5, 0xf2, 0x35, 0x13, 0x53, - 0xa0, 0xd4, 0xa2, 0xb7, 0x79, 0xcd, 0x2a, 0xe4, 0xcf, 0xa1, 0xbe, 0xc6, 0xa6, 0x46, 0x9f, 0xec, - 0xf5, 0x55, 0xaa, 0x22, 0x4f, 0xa0, 0x1b, 0x18, 0x54, 0xbe, 0x96, 0x99, 0xfc, 0x16, 0x24, 0x62, - 0x30, 0x62, 0x13, 0xdb, 0xeb, 0x94, 0xcc, 0xab, 0x10, 0xff, 0x0c, 0xf7, 0xe7, 0x06, 0x8d, 0x96, - 0xfe, 0x6e, 0x67, 0xc5, 0x70, 0xc4, 0x26, 0x9d, 0xd7, 0xaf, 0xdc, 0xff, 0xf6, 0xde, 0x3d, 0x23, - 0xd7, 0x6e, 0xf7, 0x3d, 0x3e, 0xbf, 0xc5, 0xce, 0x2d, 0xbb, 0x3d, 0x84, 0x73, 0xcb, 0xee, 0x0e, - 0x7b, 0xe3, 0x1f, 0x0c, 0xf8, 0x6d, 0xdb, 0x9e, 0xa1, 0x69, 0x8e, 0xc0, 0xc1, 0xfe, 0x11, 0x38, - 0xbc, 0xc3, 0x08, 0x58, 0xff, 0x1a, 0x81, 0xd9, 0xd9, 0xaf, 0x95, 0xc3, 0x6e, 0x56, 0x0e, 0xfb, - 0xb3, 0x72, 0xd8, 0xf7, 0xb5, 0xd3, 0xba, 0x59, 0x3b, 0xad, 0xdf, 0x6b, 0xa7, 0xf5, 0xe9, 0xf4, - 0x2a, 0xc6, 0x85, 0x09, 0xdd, 0x48, 0xa5, 0xd3, 0xc6, 0xd2, 0x2c, 0x9b, 0x6b, 0x83, 0xd7, 0xb9, - 0x2c, 0xc2, 0x63, 0x5a, 0x98, 0x37, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xb1, 0xdc, 0x42, 0x8e, - 0x60, 0x03, 0x00, 0x00, -} - -func (m *Subscription) 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 *Subscription) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Subscription) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.FutureSubscription != nil { - { - size, err := m.FutureSubscription.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSubscription(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - } - if m.AutoRenewal { - i-- - if m.AutoRenewal { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x78 - } - if m.DurationTotal != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.DurationTotal)) - i-- - dAtA[i] = 0x70 - } - if len(m.Cluster) > 0 { - i -= len(m.Cluster) - copy(dAtA[i:], m.Cluster) - i = encodeVarintSubscription(dAtA, i, uint64(len(m.Cluster))) - i-- - dAtA[i] = 0x6a - } - if m.MonthCuLeft != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.MonthCuLeft)) - i-- - dAtA[i] = 0x58 - } - if m.MonthCuTotal != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.MonthCuTotal)) - i-- - dAtA[i] = 0x50 - } - if m.MonthExpiryTime != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.MonthExpiryTime)) - i-- - dAtA[i] = 0x40 - } - if m.DurationLeft != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.DurationLeft)) - i-- - dAtA[i] = 0x38 - } - if m.DurationBought != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.DurationBought)) - i-- - dAtA[i] = 0x30 - } - if m.PlanBlock != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.PlanBlock)) - i-- - dAtA[i] = 0x28 - } - if len(m.PlanIndex) > 0 { - i -= len(m.PlanIndex) - copy(dAtA[i:], m.PlanIndex) - i = encodeVarintSubscription(dAtA, i, uint64(len(m.PlanIndex))) - i-- - dAtA[i] = 0x22 - } - if m.Block != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.Block)) - i-- - dAtA[i] = 0x18 - } - if len(m.Consumer) > 0 { - i -= len(m.Consumer) - copy(dAtA[i:], m.Consumer) - i = encodeVarintSubscription(dAtA, i, uint64(len(m.Consumer))) - i-- - dAtA[i] = 0x12 - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintSubscription(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *FutureSubscription) 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 *FutureSubscription) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FutureSubscription) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.DurationBought != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.DurationBought)) - i-- - dAtA[i] = 0x20 - } - if m.PlanBlock != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.PlanBlock)) - i-- - dAtA[i] = 0x18 - } - if len(m.PlanIndex) > 0 { - i -= len(m.PlanIndex) - copy(dAtA[i:], m.PlanIndex) - i = encodeVarintSubscription(dAtA, i, uint64(len(m.PlanIndex))) - i-- - dAtA[i] = 0x12 - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintSubscription(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintSubscription(dAtA []byte, offset int, v uint64) int { - offset -= sovSubscription(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Subscription) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovSubscription(uint64(l)) - } - l = len(m.Consumer) - if l > 0 { - n += 1 + l + sovSubscription(uint64(l)) - } - if m.Block != 0 { - n += 1 + sovSubscription(uint64(m.Block)) - } - l = len(m.PlanIndex) - if l > 0 { - n += 1 + l + sovSubscription(uint64(l)) - } - if m.PlanBlock != 0 { - n += 1 + sovSubscription(uint64(m.PlanBlock)) - } - if m.DurationBought != 0 { - n += 1 + sovSubscription(uint64(m.DurationBought)) - } - if m.DurationLeft != 0 { - n += 1 + sovSubscription(uint64(m.DurationLeft)) - } - if m.MonthExpiryTime != 0 { - n += 1 + sovSubscription(uint64(m.MonthExpiryTime)) - } - if m.MonthCuTotal != 0 { - n += 1 + sovSubscription(uint64(m.MonthCuTotal)) - } - if m.MonthCuLeft != 0 { - n += 1 + sovSubscription(uint64(m.MonthCuLeft)) - } - l = len(m.Cluster) - if l > 0 { - n += 1 + l + sovSubscription(uint64(l)) - } - if m.DurationTotal != 0 { - n += 1 + sovSubscription(uint64(m.DurationTotal)) - } - if m.AutoRenewal { - n += 2 - } - if m.FutureSubscription != nil { - l = m.FutureSubscription.Size() - n += 2 + l + sovSubscription(uint64(l)) - } - return n -} - -func (m *FutureSubscription) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovSubscription(uint64(l)) - } - l = len(m.PlanIndex) - if l > 0 { - n += 1 + l + sovSubscription(uint64(l)) - } - if m.PlanBlock != 0 { - n += 1 + sovSubscription(uint64(m.PlanBlock)) - } - if m.DurationBought != 0 { - n += 1 + sovSubscription(uint64(m.DurationBought)) - } - return n -} - -func sovSubscription(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozSubscription(x uint64) (n int) { - return sovSubscription(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Subscription) 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 ErrIntOverflowSubscription - } - 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: Subscription: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Subscription: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSubscription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Consumer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSubscription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Consumer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) - } - m.Block = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Block |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PlanIndex", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSubscription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PlanIndex = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PlanBlock", wireType) - } - m.PlanBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PlanBlock |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DurationBought", wireType) - } - m.DurationBought = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DurationBought |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DurationLeft", wireType) - } - m.DurationLeft = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DurationLeft |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MonthExpiryTime", wireType) - } - m.MonthExpiryTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MonthExpiryTime |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MonthCuTotal", wireType) - } - m.MonthCuTotal = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MonthCuTotal |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MonthCuLeft", wireType) - } - m.MonthCuLeft = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MonthCuLeft |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cluster", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSubscription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Cluster = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DurationTotal", wireType) - } - m.DurationTotal = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DurationTotal |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AutoRenewal", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AutoRenewal = bool(v != 0) - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FutureSubscription", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSubscription - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSubscription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FutureSubscription == nil { - m.FutureSubscription = &FutureSubscription{} - } - if err := m.FutureSubscription.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSubscription(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSubscription - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *FutureSubscription) 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 ErrIntOverflowSubscription - } - 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: FutureSubscription: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FutureSubscription: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSubscription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PlanIndex", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSubscription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PlanIndex = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PlanBlock", wireType) - } - m.PlanBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PlanBlock |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DurationBought", wireType) - } - m.DurationBought = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DurationBought |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSubscription(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSubscription - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipSubscription(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSubscription - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSubscription - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSubscription - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthSubscription - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupSubscription - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthSubscription - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthSubscription = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSubscription = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupSubscription = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/subscription/migrations/v7/subscription.pb.go b/x/subscription/migrations/v7/subscription.pb.go deleted file mode 100644 index aabb342d2c..0000000000 --- a/x/subscription/migrations/v7/subscription.pb.go +++ /dev/null @@ -1,1175 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: lavanet/lava/subscription/subscription.proto - -package types - -import ( - fmt "fmt" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Subscription struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - Consumer string `protobuf:"bytes,2,opt,name=consumer,proto3" json:"consumer,omitempty"` - Block uint64 `protobuf:"varint,3,opt,name=block,proto3" json:"block,omitempty"` - PlanIndex string `protobuf:"bytes,4,opt,name=plan_index,json=planIndex,proto3" json:"plan_index,omitempty"` - PlanBlock uint64 `protobuf:"varint,5,opt,name=plan_block,json=planBlock,proto3" json:"plan_block,omitempty"` - DurationBought uint64 `protobuf:"varint,6,opt,name=duration_bought,json=durationBought,proto3" json:"duration_bought,omitempty"` - DurationLeft uint64 `protobuf:"varint,7,opt,name=duration_left,json=durationLeft,proto3" json:"duration_left,omitempty"` - MonthExpiryTime uint64 `protobuf:"varint,8,opt,name=month_expiry_time,json=monthExpiryTime,proto3" json:"month_expiry_time,omitempty"` - MonthCuTotal uint64 `protobuf:"varint,10,opt,name=month_cu_total,json=monthCuTotal,proto3" json:"month_cu_total,omitempty"` - MonthCuLeft uint64 `protobuf:"varint,11,opt,name=month_cu_left,json=monthCuLeft,proto3" json:"month_cu_left,omitempty"` - Cluster string `protobuf:"bytes,13,opt,name=cluster,proto3" json:"cluster,omitempty"` - DurationTotal uint64 `protobuf:"varint,14,opt,name=duration_total,json=durationTotal,proto3" json:"duration_total,omitempty"` - FutureSubscription *FutureSubscription `protobuf:"bytes,16,opt,name=future_subscription,json=futureSubscription,proto3" json:"future_subscription,omitempty"` - AutoRenewalNextPlan string `protobuf:"bytes,17,opt,name=auto_renewal_next_plan,json=autoRenewalNextPlan,proto3" json:"auto_renewal_next_plan,omitempty"` -} - -func (m *Subscription) Reset() { *m = Subscription{} } -func (m *Subscription) String() string { return proto.CompactTextString(m) } -func (*Subscription) ProtoMessage() {} -func (*Subscription) Descriptor() ([]byte, []int) { - return fileDescriptor_c3bc5507ca237d79, []int{0} -} -func (m *Subscription) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Subscription) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Subscription.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 *Subscription) XXX_Merge(src proto.Message) { - xxx_messageInfo_Subscription.Merge(m, src) -} -func (m *Subscription) XXX_Size() int { - return m.Size() -} -func (m *Subscription) XXX_DiscardUnknown() { - xxx_messageInfo_Subscription.DiscardUnknown(m) -} - -var xxx_messageInfo_Subscription proto.InternalMessageInfo - -func (m *Subscription) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *Subscription) GetConsumer() string { - if m != nil { - return m.Consumer - } - return "" -} - -func (m *Subscription) GetBlock() uint64 { - if m != nil { - return m.Block - } - return 0 -} - -func (m *Subscription) GetPlanIndex() string { - if m != nil { - return m.PlanIndex - } - return "" -} - -func (m *Subscription) GetPlanBlock() uint64 { - if m != nil { - return m.PlanBlock - } - return 0 -} - -func (m *Subscription) GetDurationBought() uint64 { - if m != nil { - return m.DurationBought - } - return 0 -} - -func (m *Subscription) GetDurationLeft() uint64 { - if m != nil { - return m.DurationLeft - } - return 0 -} - -func (m *Subscription) GetMonthExpiryTime() uint64 { - if m != nil { - return m.MonthExpiryTime - } - return 0 -} - -func (m *Subscription) GetMonthCuTotal() uint64 { - if m != nil { - return m.MonthCuTotal - } - return 0 -} - -func (m *Subscription) GetMonthCuLeft() uint64 { - if m != nil { - return m.MonthCuLeft - } - return 0 -} - -func (m *Subscription) GetCluster() string { - if m != nil { - return m.Cluster - } - return "" -} - -func (m *Subscription) GetDurationTotal() uint64 { - if m != nil { - return m.DurationTotal - } - return 0 -} - -func (m *Subscription) GetFutureSubscription() *FutureSubscription { - if m != nil { - return m.FutureSubscription - } - return nil -} - -func (m *Subscription) GetAutoRenewalNextPlan() string { - if m != nil { - return m.AutoRenewalNextPlan - } - return "" -} - -type FutureSubscription struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - PlanIndex string `protobuf:"bytes,2,opt,name=plan_index,json=planIndex,proto3" json:"plan_index,omitempty"` - PlanBlock uint64 `protobuf:"varint,3,opt,name=plan_block,json=planBlock,proto3" json:"plan_block,omitempty"` - DurationBought uint64 `protobuf:"varint,4,opt,name=duration_bought,json=durationBought,proto3" json:"duration_bought,omitempty"` -} - -func (m *FutureSubscription) Reset() { *m = FutureSubscription{} } -func (m *FutureSubscription) String() string { return proto.CompactTextString(m) } -func (*FutureSubscription) ProtoMessage() {} -func (*FutureSubscription) Descriptor() ([]byte, []int) { - return fileDescriptor_c3bc5507ca237d79, []int{1} -} -func (m *FutureSubscription) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FutureSubscription) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_FutureSubscription.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 *FutureSubscription) XXX_Merge(src proto.Message) { - xxx_messageInfo_FutureSubscription.Merge(m, src) -} -func (m *FutureSubscription) XXX_Size() int { - return m.Size() -} -func (m *FutureSubscription) XXX_DiscardUnknown() { - xxx_messageInfo_FutureSubscription.DiscardUnknown(m) -} - -var xxx_messageInfo_FutureSubscription proto.InternalMessageInfo - -func (m *FutureSubscription) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *FutureSubscription) GetPlanIndex() string { - if m != nil { - return m.PlanIndex - } - return "" -} - -func (m *FutureSubscription) GetPlanBlock() uint64 { - if m != nil { - return m.PlanBlock - } - return 0 -} - -func (m *FutureSubscription) GetDurationBought() uint64 { - if m != nil { - return m.DurationBought - } - return 0 -} - -func init() { - proto.RegisterType((*Subscription)(nil), "lavanet.lava.subscription.SubscriptionV7") - proto.RegisterType((*FutureSubscription)(nil), "lavanet.lava.subscription.FutureSubscriptionV7") -} - -func init() { - proto.RegisterFile("lavanet/lava/subscription/subscription.proto", fileDescriptor_c3bc5507ca237d79) -} - -var fileDescriptor_c3bc5507ca237d79 = []byte{ - // 468 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0x8e, 0x5b, 0xb7, 0x4d, 0x26, 0x7f, 0xee, 0x16, 0xa1, 0x05, 0x09, 0x2b, 0x0a, 0x20, 0x22, - 0x54, 0x1c, 0x89, 0xbe, 0x41, 0x10, 0x95, 0x88, 0x10, 0x42, 0xa1, 0x27, 0x0e, 0x58, 0xb6, 0xbb, - 0x69, 0x2c, 0x6c, 0xaf, 0xb5, 0x9e, 0x05, 0xf7, 0x2d, 0xb8, 0xf0, 0x46, 0x1c, 0x38, 0xf6, 0xc8, - 0x11, 0x25, 0x2f, 0x82, 0x76, 0x9c, 0x58, 0x89, 0x0a, 0x15, 0x27, 0x6b, 0xbe, 0x1f, 0xcf, 0xee, - 0xce, 0x37, 0x70, 0x9a, 0x04, 0x5f, 0x82, 0x4c, 0xe0, 0xd8, 0x7c, 0xc7, 0x85, 0x0e, 0x8b, 0x48, - 0xc5, 0x39, 0xc6, 0x32, 0xdb, 0x29, 0xbc, 0x5c, 0x49, 0x94, 0xec, 0xc1, 0x5a, 0xed, 0x99, 0xaf, - 0xb7, 0x2d, 0x18, 0xfe, 0xb0, 0xa1, 0xf3, 0x61, 0x0b, 0x60, 0x1c, 0x8e, 0x22, 0x25, 0x02, 0x94, - 0x8a, 0x5b, 0x03, 0x6b, 0xd4, 0x9a, 0x6d, 0x4a, 0xf6, 0x10, 0x9a, 0x91, 0xcc, 0x0a, 0x9d, 0x0a, - 0xc5, 0xf7, 0x88, 0xaa, 0x6b, 0x76, 0x0f, 0x0e, 0xc2, 0x44, 0x46, 0x9f, 0xf9, 0xfe, 0xc0, 0x1a, - 0xd9, 0xb3, 0xaa, 0x60, 0x8f, 0x00, 0xf2, 0x24, 0xc8, 0xfc, 0x38, 0xbb, 0x14, 0x25, 0xb7, 0xc9, - 0xd3, 0x32, 0xc8, 0x1b, 0x03, 0xd4, 0x74, 0xe5, 0x3c, 0x20, 0x27, 0xd1, 0x13, 0x72, 0x3f, 0x83, - 0xfe, 0xa5, 0x56, 0x81, 0x39, 0x95, 0x1f, 0x4a, 0x7d, 0xb5, 0x40, 0x7e, 0x48, 0x9a, 0xde, 0x06, - 0x9e, 0x10, 0xca, 0x1e, 0x43, 0xb7, 0x16, 0x26, 0x62, 0x8e, 0xfc, 0x88, 0x64, 0x9d, 0x0d, 0xf8, - 0x56, 0xcc, 0x91, 0x3d, 0x87, 0xe3, 0x54, 0x66, 0xb8, 0xf0, 0x45, 0x99, 0xc7, 0xea, 0xda, 0xc7, - 0x38, 0x15, 0xbc, 0x49, 0xc2, 0x3e, 0x11, 0xaf, 0x09, 0xbf, 0x88, 0x53, 0xc1, 0x9e, 0x40, 0xaf, - 0xd2, 0x46, 0xda, 0x47, 0x89, 0x41, 0xc2, 0xa1, 0xfa, 0x23, 0xa1, 0xaf, 0xf4, 0x85, 0xc1, 0xd8, - 0x10, 0xba, 0xb5, 0x8a, 0xda, 0xb6, 0x49, 0xd4, 0x5e, 0x8b, 0xa8, 0xab, 0x79, 0xcd, 0x44, 0x17, - 0x28, 0x14, 0xef, 0xae, 0x5f, 0xb3, 0x2a, 0xd9, 0x53, 0xa8, 0xaf, 0xb1, 0xee, 0xd1, 0x23, 0x7b, - 0x7d, 0x95, 0xaa, 0xc9, 0x27, 0x38, 0x99, 0x6b, 0xd4, 0x4a, 0xf8, 0xdb, 0x63, 0xe3, 0xce, 0xc0, - 0x1a, 0xb5, 0x5f, 0xbe, 0xf0, 0xfe, 0x39, 0x58, 0xef, 0x9c, 0x5c, 0xdb, 0xa3, 0x9d, 0xb1, 0xf9, - 0x2d, 0x8c, 0x9d, 0xc1, 0xfd, 0x40, 0xa3, 0xf4, 0x95, 0xc8, 0xc4, 0xd7, 0x20, 0xf1, 0x33, 0x51, - 0xa2, 0x6f, 0x66, 0xc0, 0x8f, 0xe9, 0xbc, 0x27, 0x86, 0x9d, 0x55, 0xe4, 0x3b, 0x51, 0xe2, 0xfb, - 0x24, 0xc8, 0xa6, 0x76, 0xb3, 0xe5, 0xc0, 0xd4, 0x6e, 0x76, 0x9c, 0xee, 0xd4, 0x6e, 0xf6, 0x1d, - 0x67, 0xf8, 0xdd, 0x02, 0x76, 0xbb, 0xe3, 0x1d, 0x61, 0xda, 0x8d, 0xc6, 0xde, 0xdd, 0xd1, 0xd8, - 0xff, 0x8f, 0x68, 0xd8, 0x7f, 0x8b, 0xc6, 0xe4, 0xfc, 0xe7, 0xd2, 0xb5, 0x6e, 0x96, 0xae, 0xf5, - 0x7b, 0xe9, 0x5a, 0xdf, 0x56, 0x6e, 0xe3, 0x66, 0xe5, 0x36, 0x7e, 0xad, 0xdc, 0xc6, 0xc7, 0xd3, - 0xab, 0x18, 0x17, 0x3a, 0xf4, 0x22, 0x99, 0x8e, 0x77, 0x96, 0xa9, 0xdc, 0x5d, 0x27, 0xbc, 0xce, - 0x45, 0x11, 0x1e, 0xd2, 0x22, 0x9d, 0xfd, 0x09, 0x00, 0x00, 0xff, 0xff, 0xad, 0xec, 0x4c, 0x89, - 0x78, 0x03, 0x00, 0x00, -} - -func (m *Subscription) 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 *Subscription) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Subscription) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AutoRenewalNextPlan) > 0 { - i -= len(m.AutoRenewalNextPlan) - copy(dAtA[i:], m.AutoRenewalNextPlan) - i = encodeVarintSubscription(dAtA, i, uint64(len(m.AutoRenewalNextPlan))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a - } - if m.FutureSubscription != nil { - { - size, err := m.FutureSubscription.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSubscription(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - } - if m.DurationTotal != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.DurationTotal)) - i-- - dAtA[i] = 0x70 - } - if len(m.Cluster) > 0 { - i -= len(m.Cluster) - copy(dAtA[i:], m.Cluster) - i = encodeVarintSubscription(dAtA, i, uint64(len(m.Cluster))) - i-- - dAtA[i] = 0x6a - } - if m.MonthCuLeft != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.MonthCuLeft)) - i-- - dAtA[i] = 0x58 - } - if m.MonthCuTotal != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.MonthCuTotal)) - i-- - dAtA[i] = 0x50 - } - if m.MonthExpiryTime != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.MonthExpiryTime)) - i-- - dAtA[i] = 0x40 - } - if m.DurationLeft != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.DurationLeft)) - i-- - dAtA[i] = 0x38 - } - if m.DurationBought != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.DurationBought)) - i-- - dAtA[i] = 0x30 - } - if m.PlanBlock != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.PlanBlock)) - i-- - dAtA[i] = 0x28 - } - if len(m.PlanIndex) > 0 { - i -= len(m.PlanIndex) - copy(dAtA[i:], m.PlanIndex) - i = encodeVarintSubscription(dAtA, i, uint64(len(m.PlanIndex))) - i-- - dAtA[i] = 0x22 - } - if m.Block != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.Block)) - i-- - dAtA[i] = 0x18 - } - if len(m.Consumer) > 0 { - i -= len(m.Consumer) - copy(dAtA[i:], m.Consumer) - i = encodeVarintSubscription(dAtA, i, uint64(len(m.Consumer))) - i-- - dAtA[i] = 0x12 - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintSubscription(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *FutureSubscription) 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 *FutureSubscription) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FutureSubscription) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.DurationBought != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.DurationBought)) - i-- - dAtA[i] = 0x20 - } - if m.PlanBlock != 0 { - i = encodeVarintSubscription(dAtA, i, uint64(m.PlanBlock)) - i-- - dAtA[i] = 0x18 - } - if len(m.PlanIndex) > 0 { - i -= len(m.PlanIndex) - copy(dAtA[i:], m.PlanIndex) - i = encodeVarintSubscription(dAtA, i, uint64(len(m.PlanIndex))) - i-- - dAtA[i] = 0x12 - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintSubscription(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintSubscription(dAtA []byte, offset int, v uint64) int { - offset -= sovSubscription(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Subscription) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovSubscription(uint64(l)) - } - l = len(m.Consumer) - if l > 0 { - n += 1 + l + sovSubscription(uint64(l)) - } - if m.Block != 0 { - n += 1 + sovSubscription(uint64(m.Block)) - } - l = len(m.PlanIndex) - if l > 0 { - n += 1 + l + sovSubscription(uint64(l)) - } - if m.PlanBlock != 0 { - n += 1 + sovSubscription(uint64(m.PlanBlock)) - } - if m.DurationBought != 0 { - n += 1 + sovSubscription(uint64(m.DurationBought)) - } - if m.DurationLeft != 0 { - n += 1 + sovSubscription(uint64(m.DurationLeft)) - } - if m.MonthExpiryTime != 0 { - n += 1 + sovSubscription(uint64(m.MonthExpiryTime)) - } - if m.MonthCuTotal != 0 { - n += 1 + sovSubscription(uint64(m.MonthCuTotal)) - } - if m.MonthCuLeft != 0 { - n += 1 + sovSubscription(uint64(m.MonthCuLeft)) - } - l = len(m.Cluster) - if l > 0 { - n += 1 + l + sovSubscription(uint64(l)) - } - if m.DurationTotal != 0 { - n += 1 + sovSubscription(uint64(m.DurationTotal)) - } - if m.FutureSubscription != nil { - l = m.FutureSubscription.Size() - n += 2 + l + sovSubscription(uint64(l)) - } - l = len(m.AutoRenewalNextPlan) - if l > 0 { - n += 2 + l + sovSubscription(uint64(l)) - } - return n -} - -func (m *FutureSubscription) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovSubscription(uint64(l)) - } - l = len(m.PlanIndex) - if l > 0 { - n += 1 + l + sovSubscription(uint64(l)) - } - if m.PlanBlock != 0 { - n += 1 + sovSubscription(uint64(m.PlanBlock)) - } - if m.DurationBought != 0 { - n += 1 + sovSubscription(uint64(m.DurationBought)) - } - return n -} - -func sovSubscription(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozSubscription(x uint64) (n int) { - return sovSubscription(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Subscription) 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 ErrIntOverflowSubscription - } - 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: Subscription: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Subscription: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSubscription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Consumer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSubscription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Consumer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) - } - m.Block = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Block |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PlanIndex", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSubscription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PlanIndex = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PlanBlock", wireType) - } - m.PlanBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PlanBlock |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DurationBought", wireType) - } - m.DurationBought = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DurationBought |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DurationLeft", wireType) - } - m.DurationLeft = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DurationLeft |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MonthExpiryTime", wireType) - } - m.MonthExpiryTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MonthExpiryTime |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MonthCuTotal", wireType) - } - m.MonthCuTotal = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MonthCuTotal |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MonthCuLeft", wireType) - } - m.MonthCuLeft = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MonthCuLeft |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cluster", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSubscription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Cluster = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DurationTotal", wireType) - } - m.DurationTotal = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DurationTotal |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FutureSubscription", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSubscription - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSubscription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FutureSubscription == nil { - m.FutureSubscription = &FutureSubscription{} - } - if err := m.FutureSubscription.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AutoRenewalNextPlan", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSubscription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AutoRenewalNextPlan = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSubscription(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSubscription - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *FutureSubscription) 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 ErrIntOverflowSubscription - } - 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: FutureSubscription: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FutureSubscription: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSubscription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PlanIndex", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSubscription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSubscription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PlanIndex = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PlanBlock", wireType) - } - m.PlanBlock = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PlanBlock |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DurationBought", wireType) - } - m.DurationBought = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSubscription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DurationBought |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSubscription(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSubscription - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipSubscription(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSubscription - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSubscription - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSubscription - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthSubscription - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupSubscription - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthSubscription - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthSubscription = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSubscription = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupSubscription = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/subscription/module.go b/x/subscription/module.go index 6a8f4fbdbe..493b61ee1c 100644 --- a/x/subscription/module.go +++ b/x/subscription/module.go @@ -133,34 +133,6 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { migrator := keeper.NewMigrator(am.keeper) - // register v2 -> v3 migration - if err := cfg.RegisterMigration(types.ModuleName, 2, migrator.Migrate2to3); err != nil { - // panic:ok: at start up, migration cannot proceed anyhow - panic(fmt.Errorf("%s: failed to register migration to v3: %w", types.ModuleName, err)) - } - // register v3 -> v4 migration - if err := cfg.RegisterMigration(types.ModuleName, 3, migrator.Migrate3to4); err != nil { - // panic:ok: at start up, migration cannot proceed anyhow - panic(fmt.Errorf("%s: failed to register migration to v4: %w", types.ModuleName, err)) - } - // register v4 -> v5 migration - if err := cfg.RegisterMigration(types.ModuleName, 4, migrator.Migrate4to5); err != nil { - // panic:ok: at start up, migration cannot proceed anyhow - panic(fmt.Errorf("%s: failed to register migration to v5: %w", types.ModuleName, err)) - } - - // register v5 -> v6 migration - if err := cfg.RegisterMigration(types.ModuleName, 5, migrator.Migrate5to6); err != nil { - // panic:ok: at start up, migration cannot proceed anyhow - panic(fmt.Errorf("%s: failed to register migration to v6: %w", types.ModuleName, err)) - } - - // register v6 -> v7 migration - if err := cfg.RegisterMigration(types.ModuleName, 6, migrator.Migrate6to7); err != nil { - // panic:ok: at start up, migration cannot proceed anyhow - panic(fmt.Errorf("%s: failed to register migration to v6: %w", types.ModuleName, err)) - } - // register v7 -> v8 migration if err := cfg.RegisterMigration(types.ModuleName, 7, migrator.Migrate7to8); err != nil { // panic:ok: at start up, migration cannot proceed anyhow diff --git a/x/subscription/module_simulation.go b/x/subscription/module_simulation.go deleted file mode 100644 index c8047e4039..0000000000 --- a/x/subscription/module_simulation.go +++ /dev/null @@ -1,119 +0,0 @@ -package subscription - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/testutil/sims" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/lavanet/lava/v4/testutil/sample" - subscriptionsimulation "github.com/lavanet/lava/v4/x/subscription/simulation" - "github.com/lavanet/lava/v4/x/subscription/types" -) - -// avoid unused import issue -var ( - _ = sample.AccAddress - _ = subscriptionsimulation.FindAccount - _ = sims.StakePerAccount - _ = simulation.MsgEntryKind - _ = baseapp.Paramspace -) - -const ( - opWeightMsgBuy = "op_weight_msg_buy" - // TODO: Determine the simulation weight value - defaultWeightMsgBuy int = 100 - - opWeightMsgAddProject = "op_weight_msg_add_project" - // TODO: Determine the simulation weight value - defaultWeightMsgAddProject int = 100 - - opWeightMsgDelProject = "op_weight_msg_del_project" - // TODO: Determine the simulation weight value - defaultWeightMsgDelProject int = 100 - - opWeightMsgAutoRenewal = "op_weight_msg_auto_renewal" - // TODO: Determine the simulation weight value - defaultWeightMsgAutoRenewal int = 100 - - // this line is used by starport scaffolding # simapp/module/const -) - -// GenerateGenesisState creates a randomized GenState of the module -func (AppModule) GenerateGenesisState(simState *module.SimulationState) { - accs := make([]string, len(simState.Accounts)) - for i, acc := range simState.Accounts { - accs[i] = acc.Address.String() - } - subscriptionGenesis := types.GenesisState{ - Params: types.DefaultParams(), - // this line is used by starport scaffolding # simapp/module/genesisState - } - simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&subscriptionGenesis) -} - -// ProposalContents doesn't return any content functions for governance proposals -func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalMsg { - return nil -} - -// RegisterStoreDecoder registers a decoder -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} - -// WeightedOperations returns the all the gov module operations with their respective weights. -func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { - operations := make([]simtypes.WeightedOperation, 0) - - var weightMsgBuy int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgBuy, &weightMsgBuy, nil, - func(_ *rand.Rand) { - weightMsgBuy = defaultWeightMsgBuy - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgBuy, - subscriptionsimulation.SimulateMsgBuy(am.accountKeeper, am.bankKeeper, am.keeper), - )) - - var weightMsgAddProject int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgAddProject, &weightMsgAddProject, nil, - func(_ *rand.Rand) { - weightMsgAddProject = defaultWeightMsgAddProject - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgAddProject, - subscriptionsimulation.SimulateMsgAddProject(am.accountKeeper, am.bankKeeper, am.keeper), - )) - - var weightMsgDelProject int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgDelProject, &weightMsgDelProject, nil, - func(_ *rand.Rand) { - weightMsgDelProject = defaultWeightMsgDelProject - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgDelProject, - subscriptionsimulation.SimulateMsgDelProject(am.accountKeeper, am.bankKeeper, am.keeper), - )) - - var weightMsgAutoRenewal int - simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgAutoRenewal, &weightMsgAutoRenewal, nil, - func(_ *rand.Rand) { - weightMsgAutoRenewal = defaultWeightMsgAutoRenewal - }, - ) - operations = append(operations, simulation.NewWeightedOperation( - weightMsgAutoRenewal, - subscriptionsimulation.SimulateMsgAutoRenewal(am.accountKeeper, am.bankKeeper, am.keeper), - )) - - // this line is used by starport scaffolding # simapp/module/operation - - return operations -} diff --git a/x/subscription/simulation/add_project.go b/x/subscription/simulation/add_project.go deleted file mode 100644 index a82d928431..0000000000 --- a/x/subscription/simulation/add_project.go +++ /dev/null @@ -1,29 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v4/x/subscription/keeper" - "github.com/lavanet/lava/v4/x/subscription/types" -) - -func SimulateMsgAddProject( - ak types.AccountKeeper, - bk types.BankKeeper, - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - msg := &types.MsgAddProject{ - Creator: simAccount.Address.String(), - } - - // TODO: Handling the AddProject simulation - - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "AddProject simulation not implemented"), nil, nil - } -} diff --git a/x/subscription/simulation/auto_renewal.go b/x/subscription/simulation/auto_renewal.go deleted file mode 100644 index 6fc8fde634..0000000000 --- a/x/subscription/simulation/auto_renewal.go +++ /dev/null @@ -1,29 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v4/x/subscription/keeper" - "github.com/lavanet/lava/v4/x/subscription/types" -) - -func SimulateMsgAutoRenewal( - ak types.AccountKeeper, - bk types.BankKeeper, - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - msg := &types.MsgAutoRenewal{ - Creator: simAccount.Address.String(), - } - - // TODO: Handling the AutoRenewal simulation - - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "AutoRenewal simulation not implemented"), nil, nil - } -} diff --git a/x/subscription/simulation/buy.go b/x/subscription/simulation/buy.go deleted file mode 100644 index 9f3eb3b304..0000000000 --- a/x/subscription/simulation/buy.go +++ /dev/null @@ -1,29 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v4/x/subscription/keeper" - "github.com/lavanet/lava/v4/x/subscription/types" -) - -func SimulateMsgBuy( - ak types.AccountKeeper, - bk types.BankKeeper, - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - msg := &types.MsgBuy{ - Creator: simAccount.Address.String(), - } - - // TODO: Handling the Buy simulation - - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "Buy simulation not implemented"), nil, nil - } -} diff --git a/x/subscription/simulation/del_project.go b/x/subscription/simulation/del_project.go deleted file mode 100644 index 574f434ed0..0000000000 --- a/x/subscription/simulation/del_project.go +++ /dev/null @@ -1,29 +0,0 @@ -package simulation - -import ( - "math/rand" - - "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/lavanet/lava/v4/x/subscription/keeper" - "github.com/lavanet/lava/v4/x/subscription/types" -) - -func SimulateMsgDelProject( - ak types.AccountKeeper, - bk types.BankKeeper, - k keeper.Keeper, -) simtypes.Operation { - return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, - ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - simAccount, _ := simtypes.RandomAcc(r, accs) - msg := &types.MsgDelProject{ - Creator: simAccount.Address.String(), - } - - // TODO: Handling the DelProject simulation - - return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "DelProject simulation not implemented"), nil, nil - } -} diff --git a/x/subscription/simulation/simap.go b/x/subscription/simulation/simap.go deleted file mode 100644 index 92c437c0d1..0000000000 --- a/x/subscription/simulation/simap.go +++ /dev/null @@ -1,15 +0,0 @@ -package simulation - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" -) - -// FindAccount find a specific address from an account list -func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { - creator, err := sdk.AccAddressFromBech32(address) - if err != nil { - panic(err) - } - return simtypes.FindAccount(accs, creator) -}