Skip to content

Commit

Permalink
Merge pull request #9751 from vegaprotocol/fix-missing-party-sla-acco…
Browse files Browse the repository at this point in the history
…unts

fix: add old snapshot compability
  • Loading branch information
jeremyletang authored Oct 11, 2023
2 parents 1fe2ddd + 2c637aa commit 20b860f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@
- [9731](https://github.com/vegaprotocol/vega/issues/9731) - Allow team rewards to apply to all teams.
- [9727](https://github.com/vegaprotocol/vega/issues/9727) - Initialize teams earlier to avoid panic.
- [9541](https://github.com/vegaprotocol/vega/issues/9731) - Add filtering for party to the referral fees API.
- [9751](https://github.com/vegaprotocol/vega/issues/9751) - Make sure that LP fee party accounts exists.

## 0.72.1

Expand Down
7 changes: 4 additions & 3 deletions core/collateral/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ func (e *Engine) transferFees(ctx context.Context, marketID string, assetID stri
responses := make([]*types.LedgerMovement, 0, len(transfers))

for _, transfer := range transfers {
req, err := e.getFeeTransferRequest(
req, err := e.getFeeTransferRequest(ctx,
transfer, makerFee, infraFee, liquiFee, marketID, assetID)
if err != nil {
e.log.Error("Failed to build transfer request for event",
Expand Down Expand Up @@ -2001,6 +2001,7 @@ func (e *Engine) MarginUpdateOnOrder(ctx context.Context, marketID string, updat
}

func (e *Engine) getFeeTransferRequest(
ctx context.Context,
t *types.Transfer,
makerFee, infraFee, liquiFee *types.Account,
marketID, assetID string,
Expand All @@ -2021,11 +2022,11 @@ func (e *Engine) getFeeTransferRequest(
}

partyLiquidityFeeAccount := func() (*types.Account, error) {
return getAccount(marketID, t.Owner, types.AccountTypeLPLiquidityFees)
return e.GetOrCreatePartyLiquidityFeeAccount(ctx, t.Owner, marketID, assetID)
}

bonusDistributionAccount := func() (*types.Account, error) {
return getAccount(marketID, systemOwner, types.AccountTypeLiquidityFeesBonusDistribution)
return e.GetOrCreateLiquidityFeesBonusDistributionAccount(ctx, marketID, assetID)
}

marginAccount := func() (*types.Account, error) {
Expand Down

0 comments on commit 20b860f

Please sign in to comment.