Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: patch data struct #4926

Merged
merged 1 commit into from
Apr 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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