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

remove fork logic #392

Merged
merged 1 commit into from
Jan 17, 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
41 changes: 0 additions & 41 deletions x/lscosmos/keeper/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ func (k Keeper) BeginBlock(ctx sdk.Context) {
return
}

//fork logic, halt height + 1
if ctx.BlockHeight() == 9616501 {
err := MintPstakeTokens(ctx, k)
if err != nil {
panic(err)
}
}

err := utils.ApplyFuncIfNoError(ctx, k.DoDelegate)
if err != nil {
k.Logger(ctx).Error("Unable to Delegate tokens with ", "err: ", err)
Expand Down Expand Up @@ -114,36 +106,3 @@ func (k Keeper) ProcessMaturedUndelegation(ctx sdk.Context) error {
}
return nil
}

func MintPstakeTokens(ctx sdk.Context, k Keeper) error {
if ctx.ChainID() != "core-1" {
return nil
}

atomTVU := k.GetDepositAccountAmount(ctx).
Add(k.GetIBCTransferTransientAmount(ctx)).
Add(k.GetDelegationTransientAmount(ctx)).
Add(k.GetStakedAmount(ctx)).
Add(k.GetHostDelegationAccountAmount(ctx))

mintedAmount := k.GetMintedAmount(ctx)
mintDenom := k.GetHostChainParams(ctx).MintDenom
if atomTVU.LTE(mintedAmount) {
return nil
}

toNewMint := atomTVU.Sub(mintedAmount)

switch ctx.ChainID() {
case "core-1":
pstakeFeeAddress := sdk.MustAccAddressFromBech32(k.GetHostChainParams(ctx).PstakeParams.PstakeFeeAddress)
err := k.MintTokens(ctx, sdk.NewCoin(mintDenom, toNewMint), pstakeFeeAddress)
if err != nil {
k.Logger(ctx).Error("Failed to mint and send remainingAmount to pstakeFeeAddress")
return err
}
return nil
default:
return nil
}
}