Skip to content

Commit

Permalink
fix: system-tests nil pointer
Browse files Browse the repository at this point in the history
Signed-off-by: Elias Van Ootegem <[email protected]>
  • Loading branch information
EVODelavega committed Nov 7, 2023
1 parent a2cd32f commit 06d0ed6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion core/types/governance_new_market.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ func (n NewMarketConfiguration) IntoProto() *vegapb.NewMarketConfiguration {
if n.LiquidityFeeSettings != nil {
liquidityFeeSettings = n.LiquidityFeeSettings.IntoProto()
}
var liqStrat *vegapb.LiquidationStrategy
if n.LiquidationStrategy != nil {
liqStrat = n.LiquidationStrategy.IntoProto()
}

r := &vegapb.NewMarketConfiguration{
Instrument: instrument,
Expand All @@ -215,7 +219,7 @@ func (n NewMarketConfiguration) IntoProto() *vegapb.NewMarketConfiguration {
LiquiditySlaParameters: liquiditySLAParameters,
LinearSlippageFactor: n.LinearSlippageFactor.String(),
LiquidityFeeSettings: liquidityFeeSettings,
LiquidationStrategy: n.LiquidationStrategy.IntoProto(),
LiquidationStrategy: liqStrat,
}
if n.Successor != nil {
r.Successor = n.Successor.IntoProto()
Expand Down
6 changes: 5 additions & 1 deletion core/types/governance_update_market.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ func (n UpdateMarketConfiguration) IntoProto() *vegapb.UpdateMarketConfiguration
if n.LiquidityFeeSettings != nil {
liquidityFeeSettings = n.LiquidityFeeSettings.IntoProto()
}
var liqStrat *vegapb.LiquidationStrategy
if n.LiquidationStrategy != nil {
liqStrat = n.LiquidationStrategy.IntoProto()
}

r := &vegapb.UpdateMarketConfiguration{
Instrument: instrument,
Expand All @@ -214,7 +218,7 @@ func (n UpdateMarketConfiguration) IntoProto() *vegapb.UpdateMarketConfiguration
LiquiditySlaParameters: liquiditySLAParameters,
LinearSlippageFactor: n.LinearSlippageFactor.String(),
LiquidityFeeSettings: liquidityFeeSettings,
LiquidationStrategy: n.LiquidationStrategy.IntoProto(),
LiquidationStrategy: liqStrat,
}
switch rp := riskParams.(type) {
case *vegapb.UpdateMarketConfiguration_Simple:
Expand Down

0 comments on commit 06d0ed6

Please sign in to comment.