Skip to content

Commit

Permalink
Merge pull request #10 from ComposableFi/v0.1.3
Browse files Browse the repository at this point in the history
removing requests
  • Loading branch information
Ciejo authored Jun 18, 2024
2 parents 1ad408c + 470b55a commit c53f16a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 74 deletions.
6 changes: 2 additions & 4 deletions collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,10 @@ func (c *SuccintCollector) Collect(ch chan<- prometheus.Metric) {

var proofs []SuccintProof
if err := json.Unmarshal(body, &proofs); err != nil {
log.Fatalf("Error parsing JSON: %v", err)
level.Error(c.logger).Log("msg", "Error parsing JSON", "err", err)
return
}

// Print result to verify
fmt.Printf("%+v\n", proofs)

c.processMetrics(proofs, ch)

level.Debug(c.logger).Log("msg", "Stopped metrics collection")
Expand Down
78 changes: 8 additions & 70 deletions succint.go
Original file line number Diff line number Diff line change
@@ -1,73 +1,11 @@
package main

type ProofRequestData struct {
Input string `json:"input"`
}

type ProofRequest struct {
Type string `json:"type"`
ReleaseID string `json:"releaseId"`
Data ProofRequestData `json:"data"`
}

type Organization struct {
ID string `json:"id"`
OrgName string `json:"org_name"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}

type Project struct {
ID string `json:"id"`
Name string `json:"name"`
GitAccountName string `json:"git_account_name"`
OrganizationID string `json:"organization_id"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Edges struct {
Organization Organization `json:"organization"`
} `json:"edges"`
}

type Release struct {
ID string `json:"id"`
Number int `json:"number"`
ProjectID string `json:"project_id"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Edges struct {
Project Project `json:"project"`
} `json:"edges"`
}

type Request struct {
ID string `json:"id"`
ChainID int `json:"chain_id"`
GatewayAddress string `json:"gateway_address"`
Sender string `json:"sender"`
Origin string `json:"origin"`
FunctionID string `json:"function_id"`
Input string `json:"input"`
CallbackAddress string `json:"callback_address"`
CallbackData string `json:"callback_data"`
CallbackGasLimit int `json:"callback_gas_limit"`
RequestType string `json:"request_type"`
Status string `json:"status"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}

type Edges struct {
Release Release `json:"release"`
Requests []Request `json:"requests"`
}

type SuccintProof struct {
ID string `json:"id"`
Status string `json:"status"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
ProofRequest ProofRequest `json:"proof_request"`
ProofRelease string `json:"proof_release"`
Edges Edges `json:"edges"`
}
ID string json:"id"
Status string json:"status"
CreatedAt string json:"created_at"
ProofRequest interface{} json:"proof_request"
ProofRelease interface{} json:"proof_release"
Edges interface{} json:"edges"
// Requests interface{} json:"requests"
}

0 comments on commit c53f16a

Please sign in to comment.