Skip to content

Commit

Permalink
chore: buf lint + expose future cap on product
Browse files Browse the repository at this point in the history
Signed-off-by: Elias Van Ootegem <[email protected]>
  • Loading branch information
EVODelavega committed May 2, 2024
1 parent 244d1d4 commit 7a34f62
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
12 changes: 12 additions & 0 deletions core/types/market.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,8 @@ func (i InstrumentSpot) iIntoProto() interface{} {
return i.IntoProto()
}

func (_ InstrumentSpot) Cap() *FutureCap { return nil }

func InstrumentFutureFromProto(f *vegapb.Instrument_Future) *InstrumentFuture {
return &InstrumentFuture{
Future: FutureFromProto(f.Future),
Expand Down Expand Up @@ -729,15 +731,25 @@ func (i InstrumentFuture) iIntoProto() interface{} {
return i.IntoProto()
}

func (i InstrumentFuture) Cap() *FutureCap {
if i.Future.Cap == nil {
return nil
}
return i.Future.Cap.DeepClone()
}

func (i InstrumentPerps) iIntoProto() interface{} {
return i.IntoProto()
}

func (_ InstrumentPerps) Cap() *FutureCap { return nil }

type iProto interface {
iIntoProto() interface{}
getAssets() ([]string, error)
String() string
Type() ProductType
Cap() *FutureCap
}

type Instrument struct {
Expand Down
2 changes: 1 addition & 1 deletion protos/sources/vega/markets.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ message Future {
// Binding between the data spec and the data source.
DataSourceSpecToFutureBinding data_source_spec_binding = 5;
// If set, this product represents a capped future market.
optional FutureCap Cap = 6;
optional FutureCap cap = 6;
}

message FutureCap {
Expand Down
10 changes: 5 additions & 5 deletions protos/vega/markets.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7a34f62

Please sign in to comment.