Skip to content

Commit

Permalink
fix: add extra migration. (#603)
Browse files Browse the repository at this point in the history
* fix: add extra migration.

* add CHANGELOG.md
  • Loading branch information
puneet2019 authored Jul 27, 2023
1 parent be85aca commit d3e1c65
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

## [v2.2.1] - 2023-07-27

### Improvements

- [#603](https://github.com/persistenceOne/pstake-native/pull/603) Add extra code for lscosmos migration to account for
unrelayed packets.

## [v2.2.0] - 2023-07-24

### Features
Expand Down
10 changes: 10 additions & 0 deletions x/lscosmos/keeper/migrate_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,16 @@ func (k Keeper) Migrate(ctx sdk.Context) error {
IbcSequenceId: "",
})

if delegationState.HostDelegationAccountBalance.AmountOf(hcparams.BaseDenom).GT(sdk.ZeroInt()) {
k.liquidStakeIBCKeeper.SetDeposit(ctx, &liquidstakeibctypes.Deposit{
ChainId: newhc.ChainId,
Amount: sdk.NewCoin(newhc.IBCDenom(), delegationState.HostDelegationAccountBalance.AmountOf(hcparams.BaseDenom)),
Epoch: currEpoch.CurrentEpoch - 1,
State: liquidstakeibctypes.Deposit_DEPOSIT_RECEIVED,
IbcSequenceId: "",
})
}

// set fee address and params to liquidstakeibc
k.liquidStakeIBCKeeper.SetParams(ctx, liquidstakeibctypes.Params{
AdminAddress: hcparams.PstakeParams.PstakeFeeAddress,
Expand Down

0 comments on commit d3e1c65

Please sign in to comment.