Skip to content

Commit

Permalink
Merge pull request #3430 from vegaprotocol/feature/3059-remove-initia…
Browse files Browse the repository at this point in the history
…l-insurance-pool-balance

remove insurance pool initial balance from configuraton
  • Loading branch information
jeremyletang committed Apr 29, 2021
2 parents 548d128 + cfa9ad2 commit f47632e
Show file tree
Hide file tree
Showing 6 changed files with 216 additions and 90 deletions.
9 changes: 7 additions & 2 deletions collateral/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -1824,7 +1824,7 @@ func (e *Engine) ClearPartyMarginAccount(ctx context.Context, party, market, ass

// CreateMarketAccounts will create all required accounts for a market once
// a new market is accepted through the network
func (e *Engine) CreateMarketAccounts(ctx context.Context, marketID, asset string, insurance uint64) (insuranceID, settleID string, err error) {
func (e *Engine) CreateMarketAccounts(ctx context.Context, marketID, asset string) (insuranceID, settleID string, err error) {
if !e.AssetExists(asset) {
return "", "", ErrInvalidAssetID
}
Expand All @@ -1835,7 +1835,7 @@ func (e *Engine) CreateMarketAccounts(ctx context.Context, marketID, asset strin
Id: insuranceID,
Asset: asset,
Owner: systemOwner,
Balance: insurance,
Balance: 0,
MarketId: marketID,
Type: types.AccountType_ACCOUNT_TYPE_INSURANCE,
}
Expand Down Expand Up @@ -2133,6 +2133,11 @@ func (e *Engine) GetMarketLiquidityFeeAccount(market, asset string) (*types.Acco
return e.GetAccountByID(liquidityAccID)
}

func (e *Engine) GetMarketInsurancePoolAccount(market, asset string) (*types.Account, error) {
insuranceAccID := e.accountID(market, systemOwner, asset, types.AccountType_ACCOUNT_TYPE_INSURANCE)
return e.GetAccountByID(insuranceAccID)
}

// TopUpInsurancePool - this is used only for test purposed for now
// and ease out removing the insurance pool balance from configuration, this should
// definitely never be used in real code.
Expand Down

0 comments on commit f47632e

Please sign in to comment.