Skip to content

Commit

Permalink
patch data struct (#4926)
Browse files Browse the repository at this point in the history
  • Loading branch information
czarcas7ic authored Apr 16, 2023
1 parent d93d153 commit 0294419
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/cl-genesis-positions/edit_localosmosis_genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
osmosisApp "github.com/osmosis-labs/osmosis/v15/app"
"github.com/osmosis-labs/osmosis/v15/x/concentrated-liquidity/model"
"github.com/osmosis-labs/osmosis/v15/x/concentrated-liquidity/types"

cltypes "github.com/osmosis-labs/osmosis/v15/x/concentrated-liquidity/types"
clgenesis "github.com/osmosis-labs/osmosis/v15/x/concentrated-liquidity/types/genesis"
poolmanagertypes "github.com/osmosis-labs/osmosis/v15/x/poolmanager/types"
Expand Down Expand Up @@ -59,9 +60,9 @@ func EditLocalOsmosisGenesis(updatedCLGenesis *clgenesis.GenesisState, updatedBa
appState[poolmanagertypes.ModuleName] = cdc.MustMarshalJSON(&localOsmosisPoolManagerGenesis)

// Copy positions
for _, position := range updatedCLGenesis.Positions {
position.PoolId = nextPoolId
localOsmosisCLGenesis.Positions = append(localOsmosisCLGenesis.Positions, position)
for _, positionData := range updatedCLGenesis.PositionData {
positionData.Position.PoolId = nextPoolId
localOsmosisCLGenesis.PositionData = append(localOsmosisCLGenesis.PositionData, positionData)
}

// Create map of pool balances
Expand Down Expand Up @@ -122,7 +123,7 @@ func EditLocalOsmosisGenesis(updatedCLGenesis *clgenesis.GenesisState, updatedBa
localOsmosisCLGenesis.PoolData = append(localOsmosisCLGenesis.PoolData, updatedPoolData)
}

localOsmosisCLGenesis.NextPositionId = uint64(len(localOsmosisCLGenesis.Positions) + 1)
localOsmosisCLGenesis.NextPositionId = uint64(len(localOsmosisCLGenesis.PositionData) + 1)

appState[cltypes.ModuleName] = cdc.MustMarshalJSON(&localOsmosisCLGenesis)

Expand Down

0 comments on commit 0294419

Please sign in to comment.