Skip to content

Commit

Permalink
Add TraceInProgress function
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksej-paschenko committed Sep 18, 2024
1 parent c8e444a commit 67f3184
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tonapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,18 @@ func (c *Client) Request(ctx context.Context, method, endpoint string, query map

return jsonResponse, nil
}

// TraceInProgress returns true if the trace is not finished yet.
func TraceInProgress(t *Trace) bool {
for _, outMsg := range t.Transaction.OutMsgs {
if outMsg.MsgType == MessageMsgTypeIntMsg {
return true
}
}
for _, child := range t.Children {
if TraceInProgress(&child) {
return true
}
}
return false
}

0 comments on commit 67f3184

Please sign in to comment.