From 89a4dd1a6db1157d4651698e8057048d707a7283 Mon Sep 17 00:00:00 2001 From: stackman27 Date: Thu, 13 Apr 2023 15:25:56 -0700 Subject: [PATCH 1/2] added 2 genesis mapping --- .../concentrated-liquidity/genesis.proto | 38 +- x/concentrated-liquidity/export_test.go | 4 + x/concentrated-liquidity/genesis_test.go | 123 +- x/concentrated-liquidity/store.go | 9 + .../types/genesis/genesis.pb.go | 1718 ++++++++++++++--- 5 files changed, 1633 insertions(+), 259 deletions(-) diff --git a/proto/osmosis/concentrated-liquidity/genesis.proto b/proto/osmosis/concentrated-liquidity/genesis.proto index 9ad7e880552..4d31844b7eb 100644 --- a/proto/osmosis/concentrated-liquidity/genesis.proto +++ b/proto/osmosis/concentrated-liquidity/genesis.proto @@ -48,6 +48,30 @@ message PoolData { [ (gogoproto.nullable) = false ]; } +message PositionIdToPosition { + uint64 position_id = 1 [ (gogoproto.moretags) = "yaml:\"position_id\"" ]; + Position position = 2 [ (gogoproto.nullable) = false ]; +} + +message AddressToPositionId { + string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; + uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + uint64 position_id = 3 [ (gogoproto.moretags) = "yaml:\"position_id\"" ]; + Position position = 4 [ (gogoproto.nullable) = false ]; +} + +// one poolId can hav many position ids +message PoolIdToPositionIds { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + repeated uint64 position_ids = 2 + [ (gogoproto.moretags) = "yaml:\"position_id\"" ]; +} + +message PositionIdToLockId { + uint64 position_id = 1 [ (gogoproto.moretags) = "yaml:\"position_id\"" ]; + uint64 lock_id = 2 [ (gogoproto.moretags) = "yaml:\"lock_id\"" ]; +} + // GenesisState defines the concentrated liquidity module's genesis state. message GenesisState { // params are all the parameters of the module @@ -57,7 +81,19 @@ message GenesisState { repeated Position positions = 3 [ (gogoproto.nullable) = false ]; - uint64 next_position_id = 4 + repeated PositionIdToPosition position_id_to_position = 4 + [ (gogoproto.nullable) = false ]; + + repeated AddressToPositionId address_to_position_id = 5 + [ (gogoproto.nullable) = false ]; + + repeated PoolIdToPositionIds pool_id_to_position_ids = 6 + [ (gogoproto.nullable) = false ]; + + repeated PositionIdToLockId position_id_to_lock_id = 7 + [ (gogoproto.nullable) = false ]; + + uint64 next_position_id = 8 [ (gogoproto.moretags) = "yaml:\"next_position_id\"" ]; } diff --git a/x/concentrated-liquidity/export_test.go b/x/concentrated-liquidity/export_test.go index d95af7ad6d4..8a0fdd340f2 100644 --- a/x/concentrated-liquidity/export_test.go +++ b/x/concentrated-liquidity/export_test.go @@ -251,6 +251,10 @@ func (k Keeper) GetAllPositions(ctx sdk.Context) ([]model.Position, error) { return k.getAllPositions(ctx) } +func (k Keeper) GetAllPositionIdsForPoolId(ctx sdk.Context, poolId uint64) ([]uint64, error) { + return k.getAllPositionIdsForPoolId(ctx, poolId) +} + func (k Keeper) UpdatePoolForSwap(ctx sdk.Context, pool types.ConcentratedPoolExtension, sender sdk.AccAddress, tokenIn sdk.Coin, tokenOut sdk.Coin, newCurrentTick sdk.Int, newLiquidity sdk.Dec, newSqrtPrice sdk.Dec) error { return k.updatePoolForSwap(ctx, pool, sender, tokenIn, tokenOut, newCurrentTick, newLiquidity, newSqrtPrice) } diff --git a/x/concentrated-liquidity/genesis_test.go b/x/concentrated-liquidity/genesis_test.go index 9790bc17b8d..6a753c94e4f 100644 --- a/x/concentrated-liquidity/genesis_test.go +++ b/x/concentrated-liquidity/genesis_test.go @@ -26,6 +26,8 @@ type singlePoolGenesisEntry struct { feeAccumValues genesis.AccumObject incentiveAccumulators []genesis.AccumObject incentiveRecords []types.IncentiveRecord + positionIdToPosition []genesis.PositionIdToPosition + poolIdToPositionIds []genesis.PoolIdToPositionIds } var ( @@ -60,6 +62,28 @@ var ( UpperTick: 100, JoinTime: defaultBlockTime, } + + testPositionIdToPosition = genesis.PositionIdToPosition{ + PositionId: 1, + Position: testPositionModel, + } + + testAddressToPositionId = genesis.AddressToPositionId{ + Address: testAddressOne.String(), + PoolId: defaultPoolId, + PositionId: 1, + Position: testPositionModel, + } + + testPoolIdToPositionId = genesis.PoolIdToPositionIds{ + PoolId: defaultPoolId, + PositionIds: []uint64{1}, + } + + testPositionIdToLockId = genesis.PositionIdToLockId{ + PositionId: 1, + LockId: 1, + } ) func positionWithPoolId(position model.Position, poolId uint64) model.Position { @@ -138,6 +162,7 @@ func setupGenesis(baseGenesis genesis.GenesisState, poolGenesisEntries []singleP IncentiveRecords: poolGenesisEntry.incentiveRecords, }) baseGenesis.Positions = append(baseGenesis.Positions, poolGenesisEntry.positions...) + baseGenesis.PositionIdToPosition = append(baseGenesis.PositionIdToPosition, poolGenesisEntry.positionIdToPosition...) baseGenesis.NextPositionId = uint64(len(poolGenesisEntry.positions)) } @@ -160,13 +185,15 @@ func (s *KeeperTestSuite) TestInitGenesis() { defaultTime2 := time.Unix(300, 100) testCase := []struct { - name string - genesis genesis.GenesisState - expectedPools []model.Pool - expectedTicksPerPoolId map[uint64][]genesis.FullTick - expectedPositions []model.Position - expectedfeeAccumValues []genesis.AccumObject - expectedIncentiveRecords []types.IncentiveRecord + name string + genesis genesis.GenesisState + expectedPools []model.Pool + expectedTicksPerPoolId map[uint64][]genesis.FullTick + expectedPositions []model.Position + expectedfeeAccumValues []genesis.AccumObject + expectedIncentiveRecords []types.IncentiveRecord + expectedPositionIdToPosition []genesis.PositionIdToPosition + expectedPoolIdToPositionIds []genesis.PoolIdToPositionIds }{ { name: "one pool, one position, two ticks, one accumulator, two incentive records", @@ -210,6 +237,18 @@ func (s *KeeperTestSuite) TestInitGenesis() { MinUptime: testUptimeOne, }, }, + positionIdToPosition: []genesis.PositionIdToPosition{ + { + PositionId: 1, + Position: testPositionModel, + }, + }, + poolIdToPositionIds: []genesis.PoolIdToPositionIds{ + { + PoolId: defaultPoolId, + PositionIds: []uint64{1}, + }, + }, }, }), expectedPools: []model.Pool{ @@ -255,6 +294,18 @@ func (s *KeeperTestSuite) TestInitGenesis() { MinUptime: testUptimeOne, }, }, + expectedPositionIdToPosition: []genesis.PositionIdToPosition{ + { + PositionId: uint64(1), + Position: testPositionModel, + }, + }, + expectedPoolIdToPositionIds: []genesis.PoolIdToPositionIds{ + { + PoolId: defaultPoolId, + PositionIds: []uint64{1}, + }, + }, }, { name: "two pools, two positions, one tick pool one, two ticks pool two, two accumulators, one incentive records each", @@ -286,6 +337,18 @@ func (s *KeeperTestSuite) TestInitGenesis() { MinUptime: testUptimeOne, }, }, + positionIdToPosition: []genesis.PositionIdToPosition{ + { + PositionId: uint64(1), + Position: testPositionModel, + }, + }, + poolIdToPositionIds: []genesis.PoolIdToPositionIds{ + { + PoolId: defaultPoolId, + PositionIds: []uint64{1}, + }, + }, }, { pool: *poolTwo, @@ -315,6 +378,18 @@ func (s *KeeperTestSuite) TestInitGenesis() { MinUptime: testUptimeOne, }, }, + positionIdToPosition: []genesis.PositionIdToPosition{ + { + PositionId: uint64(1), + Position: testPositionModel, + }, + }, + poolIdToPositionIds: []genesis.PoolIdToPositionIds{ + { + PoolId: uint64(2), + PositionIds: []uint64{2}, + }, + }, }, }), expectedPools: []model.Pool{ @@ -371,6 +446,22 @@ func (s *KeeperTestSuite) TestInitGenesis() { }, }, expectedPositions: []model.Position{testPositionModel, withPositionId(positionWithPoolId(testPositionModel, 2), DefaultPositionId+1)}, + expectedPositionIdToPosition: []genesis.PositionIdToPosition{ + { + PositionId: uint64(1), + Position: testPositionModel, + }, + }, + expectedPoolIdToPositionIds: []genesis.PoolIdToPositionIds{ + { + PoolId: defaultPoolId, + PositionIds: []uint64{1}, + }, + { + PoolId: uint64(2), + PositionIds: []uint64{2}, + }, + }, }, } @@ -463,6 +554,24 @@ func (s *KeeperTestSuite) TestInitGenesis() { s.Require().Equal(incentiveRecord.IncentiveRecordBody.RemainingAmount.String(), tc.expectedIncentiveRecords[i].IncentiveRecordBody.RemainingAmount.String()) s.Require().True(incentiveRecord.IncentiveRecordBody.StartTime.Equal(tc.expectedIncentiveRecords[i].IncentiveRecordBody.StartTime)) } + + // validate PositionIdToPosition + for _, expPosition := range tc.expectedPositionIdToPosition { + getPosition, err := clKeeper.GetPosition(ctx, baseCase.positionId) + s.Require().NoError(err) + + s.Require().Equal(expPosition.PositionId, baseCase.positionId) + s.Require().Equal(expPosition.Position, getPosition) + } + + // validate PositionIdToPosition + for i, clPool := range clPoolsAfterInitialization { + poolIds, err := clKeeper.GetAllPositionIdsForPoolId(ctx, clPool.GetId()) + s.Require().NoError(err) + + s.Require().Equal(tc.expectedPoolIdToPositionIds[i].PositionIds, poolIds) + } + // Validate next position id. s.Require().Equal(tc.genesis.NextPositionId, clKeeper.GetNextPositionId(ctx)) }) diff --git a/x/concentrated-liquidity/store.go b/x/concentrated-liquidity/store.go index aec74a6207d..fa80841bda1 100644 --- a/x/concentrated-liquidity/store.go +++ b/x/concentrated-liquidity/store.go @@ -27,6 +27,15 @@ func (k Keeper) getAllPositions(ctx sdk.Context) ([]model.Position, error) { ctx.KVStore(k.storeKey), types.PositionIdPrefix, ParsePositionFromBz) } +// getAllPositionIdsForPoolId gets all the position for a specific poolId. +func (k Keeper) getAllPositionIdsForPoolId(ctx sdk.Context, poolId uint64) ([]uint64, error) { + parse := func(bz []byte) (uint64, error) { + return sdk.BigEndianToUint64(bz), nil + } + + return osmoutils.GatherValuesFromStorePrefix(ctx.KVStore(k.storeKey), types.KeyPoolPosition(poolId), parse) +} + // ParseLiquidityFromBz parses and returns a position's liquidity from a byte array. // Returns an error if the byte array is empty. // Returns an error if fails to parse. diff --git a/x/concentrated-liquidity/types/genesis/genesis.pb.go b/x/concentrated-liquidity/types/genesis/genesis.pb.go index 0b1227d0fa4..113ea1d2c32 100644 --- a/x/concentrated-liquidity/types/genesis/genesis.pb.go +++ b/x/concentrated-liquidity/types/genesis/genesis.pb.go @@ -175,21 +175,250 @@ func (m *PoolData) GetIncentiveRecords() []types1.IncentiveRecord { return nil } +type PositionIdToPosition struct { + PositionId uint64 `protobuf:"varint,1,opt,name=position_id,json=positionId,proto3" json:"position_id,omitempty" yaml:"position_id"` + Position model.Position `protobuf:"bytes,2,opt,name=position,proto3" json:"position"` +} + +func (m *PositionIdToPosition) Reset() { *m = PositionIdToPosition{} } +func (m *PositionIdToPosition) String() string { return proto.CompactTextString(m) } +func (*PositionIdToPosition) ProtoMessage() {} +func (*PositionIdToPosition) Descriptor() ([]byte, []int) { + return fileDescriptor_5c140d686ee6724a, []int{2} +} +func (m *PositionIdToPosition) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PositionIdToPosition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PositionIdToPosition.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 *PositionIdToPosition) XXX_Merge(src proto.Message) { + xxx_messageInfo_PositionIdToPosition.Merge(m, src) +} +func (m *PositionIdToPosition) XXX_Size() int { + return m.Size() +} +func (m *PositionIdToPosition) XXX_DiscardUnknown() { + xxx_messageInfo_PositionIdToPosition.DiscardUnknown(m) +} + +var xxx_messageInfo_PositionIdToPosition proto.InternalMessageInfo + +func (m *PositionIdToPosition) GetPositionId() uint64 { + if m != nil { + return m.PositionId + } + return 0 +} + +func (m *PositionIdToPosition) GetPosition() model.Position { + if m != nil { + return m.Position + } + return model.Position{} +} + +type AddressToPositionId struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty" yaml:"address"` + PoolId uint64 `protobuf:"varint,2,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` + PositionId uint64 `protobuf:"varint,3,opt,name=position_id,json=positionId,proto3" json:"position_id,omitempty" yaml:"position_id"` + Position model.Position `protobuf:"bytes,4,opt,name=position,proto3" json:"position"` +} + +func (m *AddressToPositionId) Reset() { *m = AddressToPositionId{} } +func (m *AddressToPositionId) String() string { return proto.CompactTextString(m) } +func (*AddressToPositionId) ProtoMessage() {} +func (*AddressToPositionId) Descriptor() ([]byte, []int) { + return fileDescriptor_5c140d686ee6724a, []int{3} +} +func (m *AddressToPositionId) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddressToPositionId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddressToPositionId.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 *AddressToPositionId) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddressToPositionId.Merge(m, src) +} +func (m *AddressToPositionId) XXX_Size() int { + return m.Size() +} +func (m *AddressToPositionId) XXX_DiscardUnknown() { + xxx_messageInfo_AddressToPositionId.DiscardUnknown(m) +} + +var xxx_messageInfo_AddressToPositionId proto.InternalMessageInfo + +func (m *AddressToPositionId) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *AddressToPositionId) GetPoolId() uint64 { + if m != nil { + return m.PoolId + } + return 0 +} + +func (m *AddressToPositionId) GetPositionId() uint64 { + if m != nil { + return m.PositionId + } + return 0 +} + +func (m *AddressToPositionId) GetPosition() model.Position { + if m != nil { + return m.Position + } + return model.Position{} +} + +// one poolId can hav many position ids +type PoolIdToPositionIds struct { + PoolId uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` + PositionIds []uint64 `protobuf:"varint,2,rep,packed,name=position_ids,json=positionIds,proto3" json:"position_ids,omitempty" yaml:"position_id"` +} + +func (m *PoolIdToPositionIds) Reset() { *m = PoolIdToPositionIds{} } +func (m *PoolIdToPositionIds) String() string { return proto.CompactTextString(m) } +func (*PoolIdToPositionIds) ProtoMessage() {} +func (*PoolIdToPositionIds) Descriptor() ([]byte, []int) { + return fileDescriptor_5c140d686ee6724a, []int{4} +} +func (m *PoolIdToPositionIds) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PoolIdToPositionIds) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PoolIdToPositionIds.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 *PoolIdToPositionIds) XXX_Merge(src proto.Message) { + xxx_messageInfo_PoolIdToPositionIds.Merge(m, src) +} +func (m *PoolIdToPositionIds) XXX_Size() int { + return m.Size() +} +func (m *PoolIdToPositionIds) XXX_DiscardUnknown() { + xxx_messageInfo_PoolIdToPositionIds.DiscardUnknown(m) +} + +var xxx_messageInfo_PoolIdToPositionIds proto.InternalMessageInfo + +func (m *PoolIdToPositionIds) GetPoolId() uint64 { + if m != nil { + return m.PoolId + } + return 0 +} + +func (m *PoolIdToPositionIds) GetPositionIds() []uint64 { + if m != nil { + return m.PositionIds + } + return nil +} + +type PositionIdToLockId struct { + PositionId uint64 `protobuf:"varint,1,opt,name=position_id,json=positionId,proto3" json:"position_id,omitempty" yaml:"position_id"` + LockId uint64 `protobuf:"varint,2,opt,name=lock_id,json=lockId,proto3" json:"lock_id,omitempty" yaml:"lock_id"` +} + +func (m *PositionIdToLockId) Reset() { *m = PositionIdToLockId{} } +func (m *PositionIdToLockId) String() string { return proto.CompactTextString(m) } +func (*PositionIdToLockId) ProtoMessage() {} +func (*PositionIdToLockId) Descriptor() ([]byte, []int) { + return fileDescriptor_5c140d686ee6724a, []int{5} +} +func (m *PositionIdToLockId) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PositionIdToLockId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PositionIdToLockId.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 *PositionIdToLockId) XXX_Merge(src proto.Message) { + xxx_messageInfo_PositionIdToLockId.Merge(m, src) +} +func (m *PositionIdToLockId) XXX_Size() int { + return m.Size() +} +func (m *PositionIdToLockId) XXX_DiscardUnknown() { + xxx_messageInfo_PositionIdToLockId.DiscardUnknown(m) +} + +var xxx_messageInfo_PositionIdToLockId proto.InternalMessageInfo + +func (m *PositionIdToLockId) GetPositionId() uint64 { + if m != nil { + return m.PositionId + } + return 0 +} + +func (m *PositionIdToLockId) GetLockId() uint64 { + if m != nil { + return m.LockId + } + return 0 +} + // GenesisState defines the concentrated liquidity module's genesis state. type GenesisState struct { // params are all the parameters of the module Params types1.Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` // pool data containining serialized pool struct and ticks. - PoolData []PoolData `protobuf:"bytes,2,rep,name=pool_data,json=poolData,proto3" json:"pool_data"` - Positions []model.Position `protobuf:"bytes,3,rep,name=positions,proto3" json:"positions"` - NextPositionId uint64 `protobuf:"varint,4,opt,name=next_position_id,json=nextPositionId,proto3" json:"next_position_id,omitempty" yaml:"next_position_id"` + PoolData []PoolData `protobuf:"bytes,2,rep,name=pool_data,json=poolData,proto3" json:"pool_data"` + Positions []model.Position `protobuf:"bytes,3,rep,name=positions,proto3" json:"positions"` + PositionIdToPosition []PositionIdToPosition `protobuf:"bytes,4,rep,name=position_id_to_position,json=positionIdToPosition,proto3" json:"position_id_to_position"` + AddressToPositionId []AddressToPositionId `protobuf:"bytes,5,rep,name=address_to_position_id,json=addressToPositionId,proto3" json:"address_to_position_id"` + PoolIdToPositionIds []PoolIdToPositionIds `protobuf:"bytes,6,rep,name=pool_id_to_position_ids,json=poolIdToPositionIds,proto3" json:"pool_id_to_position_ids"` + PositionIdToLockId []PositionIdToLockId `protobuf:"bytes,7,rep,name=position_id_to_lock_id,json=positionIdToLockId,proto3" json:"position_id_to_lock_id"` + NextPositionId uint64 `protobuf:"varint,8,opt,name=next_position_id,json=nextPositionId,proto3" json:"next_position_id,omitempty" yaml:"next_position_id"` } func (m *GenesisState) Reset() { *m = GenesisState{} } func (m *GenesisState) String() string { return proto.CompactTextString(m) } func (*GenesisState) ProtoMessage() {} func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_5c140d686ee6724a, []int{2} + return fileDescriptor_5c140d686ee6724a, []int{6} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -239,6 +468,34 @@ func (m *GenesisState) GetPositions() []model.Position { return nil } +func (m *GenesisState) GetPositionIdToPosition() []PositionIdToPosition { + if m != nil { + return m.PositionIdToPosition + } + return nil +} + +func (m *GenesisState) GetAddressToPositionId() []AddressToPositionId { + if m != nil { + return m.AddressToPositionId + } + return nil +} + +func (m *GenesisState) GetPoolIdToPositionIds() []PoolIdToPositionIds { + if m != nil { + return m.PoolIdToPositionIds + } + return nil +} + +func (m *GenesisState) GetPositionIdToLockId() []PositionIdToLockId { + if m != nil { + return m.PositionIdToLockId + } + return nil +} + func (m *GenesisState) GetNextPositionId() uint64 { if m != nil { return m.NextPositionId @@ -256,7 +513,7 @@ func (m *AccumObject) Reset() { *m = AccumObject{} } func (m *AccumObject) String() string { return proto.CompactTextString(m) } func (*AccumObject) ProtoMessage() {} func (*AccumObject) Descriptor() ([]byte, []int) { - return fileDescriptor_5c140d686ee6724a, []int{3} + return fileDescriptor_5c140d686ee6724a, []int{7} } func (m *AccumObject) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -302,6 +559,10 @@ func (m *AccumObject) GetAccumContent() *accum.AccumulatorContent { func init() { proto.RegisterType((*FullTick)(nil), "osmosis.concentratedliquidity.v1beta1.FullTick") proto.RegisterType((*PoolData)(nil), "osmosis.concentratedliquidity.v1beta1.PoolData") + proto.RegisterType((*PositionIdToPosition)(nil), "osmosis.concentratedliquidity.v1beta1.PositionIdToPosition") + proto.RegisterType((*AddressToPositionId)(nil), "osmosis.concentratedliquidity.v1beta1.AddressToPositionId") + proto.RegisterType((*PoolIdToPositionIds)(nil), "osmosis.concentratedliquidity.v1beta1.PoolIdToPositionIds") + proto.RegisterType((*PositionIdToLockId)(nil), "osmosis.concentratedliquidity.v1beta1.PositionIdToLockId") proto.RegisterType((*GenesisState)(nil), "osmosis.concentratedliquidity.v1beta1.GenesisState") proto.RegisterType((*AccumObject)(nil), "osmosis.concentratedliquidity.v1beta1.AccumObject") } @@ -311,54 +572,69 @@ func init() { } var fileDescriptor_5c140d686ee6724a = []byte{ - // 740 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xcd, 0x6e, 0x13, 0x3b, - 0x14, 0xce, 0x34, 0xd3, 0xde, 0xc6, 0xe9, 0xed, 0x8f, 0xd5, 0xdb, 0xce, 0xed, 0xd5, 0x9d, 0x84, - 0x41, 0x95, 0x8a, 0x4a, 0x66, 0xd4, 0x94, 0xb2, 0x60, 0xd7, 0x29, 0x3f, 0x0a, 0x0b, 0xa8, 0xa6, - 0x5d, 0x81, 0x50, 0xe4, 0xcc, 0x38, 0xc1, 0x74, 0x62, 0x87, 0xd8, 0xa9, 0x12, 0xb1, 0xe3, 0x09, - 0x10, 0x3b, 0xde, 0x83, 0x37, 0x60, 0x53, 0x21, 0x16, 0x5d, 0xb2, 0x8a, 0x50, 0xfb, 0x06, 0x79, - 0x02, 0x34, 0xb6, 0x27, 0x49, 0x2b, 0x50, 0x52, 0x76, 0x63, 0x9f, 0xef, 0xfb, 0xce, 0x77, 0xec, - 0xe3, 0x33, 0xe0, 0x2e, 0xe3, 0x4d, 0xc6, 0x09, 0xf7, 0x42, 0x46, 0x43, 0x4c, 0x45, 0x1b, 0x09, - 0x1c, 0x95, 0x62, 0xf2, 0xb6, 0x43, 0x22, 0x22, 0x7a, 0x5e, 0x03, 0x53, 0xcc, 0x09, 0x77, 0x5b, - 0x6d, 0x26, 0x18, 0xdc, 0xd4, 0x68, 0x77, 0x1c, 0x3d, 0x04, 0xbb, 0xa7, 0x3b, 0x35, 0x2c, 0xd0, - 0xce, 0xc6, 0x6a, 0x83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xb9, 0x21, 0x6b, 0x7a, 0x5a, 0xbc, 0x14, 0xa3, - 0x1a, 0x4f, 0x17, 0xde, 0xe9, 0xce, 0x9e, 0xd7, 0xfd, 0xed, 0x4c, 0xed, 0xb5, 0x30, 0x4f, 0xff, - 0x4c, 0xb5, 0x39, 0x39, 0x29, 0x76, 0x7f, 0x06, 0x00, 0x00, 0xff, 0xff, 0x76, 0x72, 0xdb, 0xb7, - 0xca, 0x06, 0x00, 0x00, + // 978 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcd, 0x6e, 0x23, 0x45, + 0x10, 0xce, 0xc4, 0x8e, 0x93, 0xb4, 0x43, 0x36, 0xdb, 0x31, 0xce, 0xb0, 0x08, 0x3b, 0x34, 0x8a, + 0x14, 0x94, 0xcd, 0x8c, 0x92, 0x65, 0x41, 0xbb, 0x9c, 0xe2, 0xe5, 0x47, 0x46, 0x08, 0xc2, 0x6c, + 0x4e, 0x20, 0x64, 0xb5, 0x67, 0xda, 0xa6, 0xc9, 0x78, 0xda, 0xb8, 0xdb, 0x96, 0x0d, 0xe2, 0xc2, + 0x13, 0x20, 0x6e, 0x1c, 0xe1, 0x19, 0x78, 0x88, 0x15, 0xe2, 0xb0, 0x47, 0x4e, 0x16, 0x4a, 0xde, + 0xc0, 0x67, 0x0e, 0x68, 0xfa, 0xc7, 0x33, 0x76, 0x1c, 0xd9, 0x8e, 0xb8, 0x4d, 0x77, 0x57, 0xd5, + 0xf7, 0x55, 0x75, 0x7d, 0xd5, 0x03, 0x1e, 0x32, 0xde, 0x62, 0x9c, 0x72, 0xd7, 0x67, 0x91, 0x4f, + 0x22, 0xd1, 0xc1, 0x82, 0x04, 0xc7, 0x21, 0xfd, 0xae, 0x4b, 0x03, 0x2a, 0x06, 0x6e, 0x93, 0x44, + 0x84, 0x53, 0xee, 0xb4, 0x3b, 0x4c, 0x30, 0x78, 0xa0, 0x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e4, 0x21, 0xfc, 0x0c, 0xbc, 0x22, 0x9f, 0xa2, 0x9a, 0xcf, 0x22, 0x41, 0x22, 0xa1, + 0x47, 0xf5, 0xdb, 0xe3, 0x3c, 0xd5, 0x1f, 0xdd, 0xc4, 0xe3, 0xa6, 0x9e, 0xa7, 0x67, 0xca, 0xc1, + 0xdb, 0x92, 0x16, 0x7a, 0x55, 0x09, 0x5e, 0x5c, 0x95, 0xac, 0x97, 0x57, 0x25, 0xeb, 0x9f, 0xab, + 0x92, 0xf5, 0xf3, 0x75, 0x69, 0xe5, 0xe5, 0x75, 0x69, 0xe5, 0xef, 0xeb, 0xd2, 0xca, 0x97, 0x9f, + 0x34, 0xa9, 0xf8, 0xa6, 0x5b, 0x77, 0x7c, 0xd6, 0x72, 0x75, 0xf0, 0xe3, 0x10, 0xd7, 0xb9, 0x59, + 0xb8, 0xbd, 0x93, 0xc7, 0x6e, 0xff, 0xd6, 0x1f, 0xba, 0x41, 0x9b, 0x70, 0xf3, 0x5b, 0x5c, 0xcf, + 0xc9, 0xdf, 0x94, 0x47, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0xba, 0x4b, 0x73, 0x7e, 0x47, 0x0b, + 0x00, 0x00, } func (m *FullTick) Marshal() (dAtA []byte, err error) { @@ -491,7 +767,7 @@ func (m *PoolData) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *GenesisState) Marshal() (dAtA []byte, err error) { +func (m *PositionIdToPosition) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -501,51 +777,18 @@ func (m *GenesisState) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { +func (m *PositionIdToPosition) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PositionIdToPosition) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.NextPositionId != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.NextPositionId)) - i-- - dAtA[i] = 0x20 - } - if len(m.Positions) > 0 { - for iNdEx := len(m.Positions) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Positions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.PoolData) > 0 { - for iNdEx := len(m.PoolData) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PoolData[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Position.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -553,11 +796,16 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 + if m.PositionId != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.PositionId)) + i-- + dAtA[i] = 0x8 + } return len(dAtA) - i, nil } -func (m *AccumObject) Marshal() (dAtA []byte, err error) { +func (m *AddressToPositionId) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -567,53 +815,304 @@ func (m *AccumObject) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *AccumObject) MarshalTo(dAtA []byte) (int, error) { +func (m *AddressToPositionId) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *AccumObject) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AddressToPositionId) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.AccumContent != nil { - { - size, err := m.AccumContent.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) + { + size, err := m.Position.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if m.PositionId != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.PositionId)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x18 } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Name))) + if m.PoolId != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.PoolId)) + i-- + dAtA[i] = 0x10 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Address))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *PoolIdToPositionIds) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *FullTick) Size() (n int) { - if m == nil { - return 0 - } + +func (m *PoolIdToPositionIds) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PoolIdToPositionIds) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PositionIds) > 0 { + dAtA7 := make([]byte, len(m.PositionIds)*10) + var j6 int + for _, num := range m.PositionIds { + for num >= 1<<7 { + dAtA7[j6] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j6++ + } + dAtA7[j6] = uint8(num) + j6++ + } + i -= j6 + copy(dAtA[i:], dAtA7[:j6]) + i = encodeVarintGenesis(dAtA, i, uint64(j6)) + i-- + dAtA[i] = 0x12 + } + if m.PoolId != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.PoolId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *PositionIdToLockId) 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 *PositionIdToLockId) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PositionIdToLockId) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.LockId != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.LockId)) + i-- + dAtA[i] = 0x10 + } + if m.PositionId != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.PositionId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NextPositionId != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.NextPositionId)) + i-- + dAtA[i] = 0x40 + } + if len(m.PositionIdToLockId) > 0 { + for iNdEx := len(m.PositionIdToLockId) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PositionIdToLockId[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if len(m.PoolIdToPositionIds) > 0 { + for iNdEx := len(m.PoolIdToPositionIds) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PoolIdToPositionIds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if len(m.AddressToPositionId) > 0 { + for iNdEx := len(m.AddressToPositionId) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AddressToPositionId[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.PositionIdToPosition) > 0 { + for iNdEx := len(m.PositionIdToPosition) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PositionIdToPosition[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Positions) > 0 { + for iNdEx := len(m.Positions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Positions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.PoolData) > 0 { + for iNdEx := len(m.PoolData) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PoolData[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *AccumObject) 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 *AccumObject) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AccumObject) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AccumContent != nil { + { + size, err := m.AccumContent.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *FullTick) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.PoolId != 0 { @@ -660,60 +1159,153 @@ func (m *PoolData) Size() (n int) { return n } -func (m *GenesisState) Size() (n int) { +func (m *PositionIdToPosition) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) - if len(m.PoolData) > 0 { - for _, e := range m.PoolData { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.Positions) > 0 { - for _, e := range m.Positions { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if m.NextPositionId != 0 { - n += 1 + sovGenesis(uint64(m.NextPositionId)) + if m.PositionId != 0 { + n += 1 + sovGenesis(uint64(m.PositionId)) } + l = m.Position.Size() + n += 1 + l + sovGenesis(uint64(l)) return n } -func (m *AccumObject) Size() (n int) { +func (m *AddressToPositionId) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Name) + l = len(m.Address) if l > 0 { n += 1 + l + sovGenesis(uint64(l)) } - if m.AccumContent != nil { - l = m.AccumContent.Size() - n += 1 + l + sovGenesis(uint64(l)) + if m.PoolId != 0 { + n += 1 + sovGenesis(uint64(m.PoolId)) + } + if m.PositionId != 0 { + n += 1 + sovGenesis(uint64(m.PositionId)) } + l = m.Position.Size() + n += 1 + l + sovGenesis(uint64(l)) return n } -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +func (m *PoolIdToPositionIds) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PoolId != 0 { + n += 1 + sovGenesis(uint64(m.PoolId)) + } + if len(m.PositionIds) > 0 { + l = 0 + for _, e := range m.PositionIds { + l += sovGenesis(uint64(e)) + } + n += 1 + sovGenesis(uint64(l)) + l + } + return n } -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + +func (m *PositionIdToLockId) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PositionId != 0 { + n += 1 + sovGenesis(uint64(m.PositionId)) + } + if m.LockId != 0 { + n += 1 + sovGenesis(uint64(m.LockId)) + } + return n } -func (m *FullTick) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx + +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + if len(m.PoolData) > 0 { + for _, e := range m.PoolData { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.Positions) > 0 { + for _, e := range m.Positions { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.PositionIdToPosition) > 0 { + for _, e := range m.PositionIdToPosition { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.AddressToPositionId) > 0 { + for _, e := range m.AddressToPositionId { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.PoolIdToPositionIds) > 0 { + for _, e := range m.PoolIdToPositionIds { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.PositionIdToLockId) > 0 { + for _, e := range m.PositionIdToLockId { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if m.NextPositionId != 0 { + n += 1 + sovGenesis(uint64(m.NextPositionId)) + } + return n +} + +func (m *AccumObject) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if m.AccumContent != nil { + l = m.AccumContent.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *FullTick) 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 { @@ -757,11 +1349,487 @@ func (m *FullTick) Unmarshal(dAtA []byte) error { break } } - case 2: + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TickIndex", wireType) + } + m.TickIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TickIndex |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PoolData) 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 ErrIntOverflowGenesis + } + 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: PoolData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PoolData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pool", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pool == nil { + m.Pool = &types.Any{} + } + if err := m.Pool.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ticks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ticks = append(m.Ticks, FullTick{}) + if err := m.Ticks[len(m.Ticks)-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 FeeAccumulator", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.FeeAccumulator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IncentivesAccumulators", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IncentivesAccumulators = append(m.IncentivesAccumulators, AccumObject{}) + if err := m.IncentivesAccumulators[len(m.IncentivesAccumulators)-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 IncentiveRecords", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IncentiveRecords = append(m.IncentiveRecords, types1.IncentiveRecord{}) + if err := m.IncentiveRecords[len(m.IncentiveRecords)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PositionIdToPosition) 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 ErrIntOverflowGenesis + } + 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: PositionIdToPosition: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PositionIdToPosition: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PositionId", wireType) + } + m.PositionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PositionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Position.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddressToPositionId) 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 ErrIntOverflowGenesis + } + 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: AddressToPositionId: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddressToPositionId: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) + } + m.PoolId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PoolId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TickIndex", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PositionId", wireType) } - m.TickIndex = 0 + m.PositionId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -771,14 +1839,14 @@ func (m *FullTick) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.TickIndex |= int64(b&0x7F) << shift + m.PositionId |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 3: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Position", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -805,7 +1873,7 @@ func (m *FullTick) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Position.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -830,7 +1898,7 @@ func (m *FullTick) Unmarshal(dAtA []byte) error { } return nil } -func (m *PoolData) Unmarshal(dAtA []byte) error { +func (m *PoolIdToPositionIds) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -853,17 +1921,17 @@ func (m *PoolData) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PoolData: wiretype end group for non-group") + return fmt.Errorf("proto: PoolIdToPositionIds: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PoolData: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PoolIdToPositionIds: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pool", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) } - var msglen int + m.PoolId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -873,31 +1941,228 @@ func (m *PoolData) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.PoolId |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthGenesis + case 2: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.PositionIds = append(m.PositionIds, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.PositionIds) == 0 { + m.PositionIds = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.PositionIds = append(m.PositionIds, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field PositionIds", wireType) } - postIndex := iNdEx + msglen - if postIndex < 0 { + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthGenesis } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - if m.Pool == nil { - m.Pool = &types.Any{} + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PositionIdToLockId) 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 ErrIntOverflowGenesis } - if err := m.Pool.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + 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: PositionIdToLockId: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PositionIdToLockId: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PositionId", wireType) + } + m.PositionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PositionId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - iNdEx = postIndex case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LockId", wireType) + } + m.LockId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LockId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ticks", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -924,14 +2189,13 @@ func (m *PoolData) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Ticks = append(m.Ticks, FullTick{}) - if err := m.Ticks[len(m.Ticks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FeeAccumulator", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PoolData", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -958,13 +2222,14 @@ func (m *PoolData) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.FeeAccumulator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.PoolData = append(m.PoolData, PoolData{}) + if err := m.PoolData[len(m.PoolData)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 4: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IncentivesAccumulators", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Positions", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -991,14 +2256,14 @@ func (m *PoolData) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.IncentivesAccumulators = append(m.IncentivesAccumulators, AccumObject{}) - if err := m.IncentivesAccumulators[len(m.IncentivesAccumulators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Positions = append(m.Positions, model.Position{}) + if err := m.Positions[len(m.Positions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IncentiveRecords", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PositionIdToPosition", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1025,64 +2290,14 @@ func (m *PoolData) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.IncentiveRecords = append(m.IncentiveRecords, types1.IncentiveRecord{}) - if err := m.IncentiveRecords[len(m.IncentiveRecords)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.PositionIdToPosition = append(m.PositionIdToPosition, PositionIdToPosition{}) + if err := m.PositionIdToPosition[len(m.PositionIdToPosition)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GenesisState) 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 ErrIntOverflowGenesis - } - 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: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AddressToPositionId", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1109,13 +2324,14 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.AddressToPositionId = append(m.AddressToPositionId, AddressToPositionId{}) + if err := m.AddressToPositionId[len(m.AddressToPositionId)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolData", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PoolIdToPositionIds", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1142,14 +2358,14 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.PoolData = append(m.PoolData, PoolData{}) - if err := m.PoolData[len(m.PoolData)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.PoolIdToPositionIds = append(m.PoolIdToPositionIds, PoolIdToPositionIds{}) + if err := m.PoolIdToPositionIds[len(m.PoolIdToPositionIds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Positions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PositionIdToLockId", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1176,12 +2392,12 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Positions = append(m.Positions, model.Position{}) - if err := m.Positions[len(m.Positions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.PositionIdToLockId = append(m.PositionIdToLockId, PositionIdToLockId{}) + if err := m.PositionIdToLockId[len(m.PositionIdToLockId)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 4: + case 8: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field NextPositionId", wireType) } From c63da761e6aa5b3fe200a4a868b2beef9c428166 Mon Sep 17 00:00:00 2001 From: stackman27 Date: Thu, 13 Apr 2023 16:18:57 -0700 Subject: [PATCH 2/2] added PoolIdToPositionIds --- x/concentrated-liquidity/genesis.go | 33 +++++++++++++++--- x/concentrated-liquidity/genesis_test.go | 44 +++++++++++++++++++++++- 2 files changed, 72 insertions(+), 5 deletions(-) diff --git a/x/concentrated-liquidity/genesis.go b/x/concentrated-liquidity/genesis.go index 4cfb11cc575..a4d7646b01a 100644 --- a/x/concentrated-liquidity/genesis.go +++ b/x/concentrated-liquidity/genesis.go @@ -80,6 +80,7 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *genesis.GenesisState { } poolData := make([]genesis.PoolData, 0, len(pools)) + var poolIdToPositionIds []genesis.PoolIdToPositionIds for _, poolI := range pools { poolI := poolI @@ -145,6 +146,15 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *genesis.GenesisState { IncentivesAccumulators: incentivesAccumObject, IncentiveRecords: incentiveRecordsForPool, }) + + positionids, err := k.getAllPositionIdsForPoolId(ctx, poolId) + if err != nil { + panic(err) + } + poolIdToPositionIds = append(poolIdToPositionIds, genesis.PoolIdToPositionIds{ + PoolId: poolId, + PositionIds: positionids, + }) } positions, err := k.getAllPositions(ctx) @@ -152,10 +162,25 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *genesis.GenesisState { panic(err) } + var positionIdToPosition []genesis.PositionIdToPosition + for _, position := range positions { + getPosition, err := k.GetPosition(ctx, position.PositionId) + if err != nil { + panic(err) + } + + positionIdToPosition = append(positionIdToPosition, genesis.PositionIdToPosition{ + PositionId: getPosition.GetPositionId(), + Position: getPosition, + }) + } + return &genesis.GenesisState{ - Params: k.GetParams(ctx), - PoolData: poolData, - Positions: positions, - NextPositionId: k.GetNextPositionId(ctx), + Params: k.GetParams(ctx), + PoolData: poolData, + Positions: positions, + PositionIdToPosition: positionIdToPosition, + PoolIdToPositionIds: poolIdToPositionIds, + NextPositionId: k.GetNextPositionId(ctx), } } diff --git a/x/concentrated-liquidity/genesis_test.go b/x/concentrated-liquidity/genesis_test.go index 6a753c94e4f..2e0fc9ceedb 100644 --- a/x/concentrated-liquidity/genesis_test.go +++ b/x/concentrated-liquidity/genesis_test.go @@ -163,6 +163,7 @@ func setupGenesis(baseGenesis genesis.GenesisState, poolGenesisEntries []singleP }) baseGenesis.Positions = append(baseGenesis.Positions, poolGenesisEntry.positions...) baseGenesis.PositionIdToPosition = append(baseGenesis.PositionIdToPosition, poolGenesisEntry.positionIdToPosition...) + baseGenesis.PoolIdToPositionIds = append(baseGenesis.PoolIdToPositionIds, poolGenesisEntry.poolIdToPositionIds...) baseGenesis.NextPositionId = uint64(len(poolGenesisEntry.positions)) } @@ -385,6 +386,10 @@ func (s *KeeperTestSuite) TestInitGenesis() { }, }, poolIdToPositionIds: []genesis.PoolIdToPositionIds{ + { + PoolId: defaultPoolId, + PositionIds: []uint64{1}, + }, { PoolId: uint64(2), PositionIds: []uint64{2}, @@ -640,6 +645,18 @@ func (s *KeeperTestSuite) TestExportGenesis() { MinUptime: testUptimeOne, }, }, + positionIdToPosition: []genesis.PositionIdToPosition{ + { + PositionId: uint64(1), + Position: testPositionModel, + }, + }, + poolIdToPositionIds: []genesis.PoolIdToPositionIds{ + { + PoolId: uint64(1), + PositionIds: []uint64{1}, + }, + }, }, }), }, @@ -702,6 +719,26 @@ func (s *KeeperTestSuite) TestExportGenesis() { }, }, positions: []model.Position{withPositionId(positionWithPoolId(testPositionModel, 2), DefaultPositionId+1)}, + positionIdToPosition: []genesis.PositionIdToPosition{ + { + PositionId: uint64(1), + Position: testPositionModel, + }, + { + PositionId: uint64(2), + Position: withPositionId(positionWithPoolId(testPositionModel, 2), defaultPoolId+1), + }, + }, + poolIdToPositionIds: []genesis.PoolIdToPositionIds{ + { + PoolId: uint64(1), + PositionIds: []uint64{1}, + }, + { + PoolId: uint64(2), + PositionIds: []uint64{2}, + }, + }, }, }), }, @@ -753,7 +790,6 @@ func (s *KeeperTestSuite) TestExportGenesis() { s.Require().Equal(incentiveRecord.IncentiveRecordBody.RemainingAmount.String(), expectedPoolData.IncentiveRecords[i].IncentiveRecordBody.RemainingAmount.String()) s.Require().True(incentiveRecord.IncentiveRecordBody.StartTime.Equal(expectedPoolData.IncentiveRecords[i].IncentiveRecordBody.StartTime)) } - } // Validate positions. @@ -761,6 +797,12 @@ func (s *KeeperTestSuite) TestExportGenesis() { // Validate next position id. s.Require().Equal(tc.genesis.NextPositionId, actualExported.NextPositionId) + + // Validate PositionIdToPosition + s.Require().Equal(tc.genesis.PositionIdToPosition, actualExported.PositionIdToPosition) + + // Validate PoolIdToPositionIds + s.Require().Equal(tc.genesis.PoolIdToPositionIds, actualExported.PoolIdToPositionIds) }) } }