diff --git a/api/openapi.json b/api/openapi.json index 40cfd697..9378f071 100644 --- a/api/openapi.json +++ b/api/openapi.json @@ -5457,6 +5457,11 @@ "example": false, "type": "boolean" }, + "in_progress": { + "description": "Trace is not finished yet. Transactions still happening", + "example": false, + "type": "boolean" + }, "interfaces": { "example": [ "wallet", @@ -5473,7 +5478,8 @@ }, "required": [ "transaction", - "interfaces" + "interfaces", + "in_progress" ], "type": "object" }, diff --git a/api/openapi.yml b/api/openapi.yml index aa1115c7..60e57082 100644 --- a/api/openapi.yml +++ b/api/openapi.yml @@ -6527,6 +6527,7 @@ components: required: - transaction - interfaces + - in_progress properties: transaction: $ref: '#/components/schemas/Transaction' @@ -6535,6 +6536,10 @@ components: items: type: string example: [ "wallet", "tep62_item" ] + in_progress: + type: boolean + example: false + description: Trace is not finished yet. Transactions still happening children: type: array items: diff --git a/pkg/api/event_converters.go b/pkg/api/event_converters.go index 4158d228..d71c7696 100644 --- a/pkg/api/event_converters.go +++ b/pkg/api/event_converters.go @@ -45,7 +45,11 @@ func distinctAccounts(skip *tongo.AccountID, book addressBook, accounts ...*tong } func convertTrace(t *core.Trace, book addressBook) oas.Trace { - trace := oas.Trace{Transaction: convertTransaction(t.Transaction, t.AccountInterfaces, book), Interfaces: g.ToStrings(t.AccountInterfaces)} + trace := oas.Trace{ + Transaction: convertTransaction(t.Transaction, t.AccountInterfaces, book), + Interfaces: g.ToStrings(t.AccountInterfaces), + InProgress: t.InProgress(), + } sort.Slice(t.Children, func(i, j int) bool { if t.Children[i].InMsg == nil || t.Children[j].InMsg == nil { diff --git a/pkg/oas/oas_json_gen.go b/pkg/oas/oas_json_gen.go index fb1b3718..4cb7f601 100644 --- a/pkg/oas/oas_json_gen.go +++ b/pkg/oas/oas_json_gen.go @@ -36173,6 +36173,10 @@ func (s *Trace) encodeFields(e *jx.Encoder) { } e.ArrEnd() } + { + e.FieldStart("in_progress") + e.Bool(s.InProgress) + } { if s.Children != nil { e.FieldStart("children") @@ -36191,11 +36195,12 @@ func (s *Trace) encodeFields(e *jx.Encoder) { } } -var jsonFieldsNameOfTrace = [4]string{ +var jsonFieldsNameOfTrace = [5]string{ 0: "transaction", 1: "interfaces", - 2: "children", - 3: "emulated", + 2: "in_progress", + 3: "children", + 4: "emulated", } // Decode decodes Trace from json. @@ -36237,6 +36242,18 @@ func (s *Trace) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"interfaces\"") } + case "in_progress": + requiredBitSet[0] |= 1 << 2 + if err := func() error { + v, err := d.Bool() + s.InProgress = bool(v) + if err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"in_progress\"") + } case "children": if err := func() error { s.Children = make([]Trace, 0) @@ -36274,7 +36291,7 @@ func (s *Trace) Decode(d *jx.Decoder) error { // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00000011, + 0b00000111, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. diff --git a/pkg/oas/oas_schemas_gen.go b/pkg/oas/oas_schemas_gen.go index 49141413..afd12ec9 100644 --- a/pkg/oas/oas_schemas_gen.go +++ b/pkg/oas/oas_schemas_gen.go @@ -15554,8 +15554,10 @@ func (s *TonTransferAction) SetRefund(val OptRefund) { type Trace struct { Transaction Transaction `json:"transaction"` Interfaces []string `json:"interfaces"` - Children []Trace `json:"children"` - Emulated OptBool `json:"emulated"` + // Trace is not finished yet. Transactions still happening. + InProgress bool `json:"in_progress"` + Children []Trace `json:"children"` + Emulated OptBool `json:"emulated"` } // GetTransaction returns the value of Transaction. @@ -15568,6 +15570,11 @@ func (s *Trace) GetInterfaces() []string { return s.Interfaces } +// GetInProgress returns the value of InProgress. +func (s *Trace) GetInProgress() bool { + return s.InProgress +} + // GetChildren returns the value of Children. func (s *Trace) GetChildren() []Trace { return s.Children @@ -15588,6 +15595,11 @@ func (s *Trace) SetInterfaces(val []string) { s.Interfaces = val } +// SetInProgress sets the value of InProgress. +func (s *Trace) SetInProgress(val bool) { + s.InProgress = val +} + // SetChildren sets the value of Children. func (s *Trace) SetChildren(val []Trace) { s.Children = val