Skip to content

Commit

Permalink
Feature: add total bytes to API
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Dec 9, 2024
1 parent b756337 commit a8526df
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/api/docs/docs.go

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

5 changes: 5 additions & 0 deletions cmd/api/docs/swagger.json

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

4 changes: 4 additions & 0 deletions cmd/api/docs/swagger.yaml

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

2 changes: 2 additions & 0 deletions cmd/api/handler/responses/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type State struct {
TotalAccounts int64 `example:"43" format:"int64" json:"total_accounts" swaggertype:"integer"`
TotalRollups int64 `example:"312" format:"int64" json:"total_rollups" swaggertype:"integer"`
TotalBridges int64 `example:"312" format:"int64" json:"total_bridges" swaggertype:"integer"`
TotalBytes int64 `example:"312" format:"int64" json:"total_bytes" swaggertype:"integer"`
TotalSupply string `example:"312" format:"string" json:"total_supply" swaggertype:"string"`
Synced bool `example:"true" format:"boolean" json:"synced" swaggertype:"boolean"`
}
Expand All @@ -39,6 +40,7 @@ func NewState(state storage.State) State {
TotalAccounts: state.TotalAccounts,
TotalRollups: state.TotalRollups,
TotalBridges: state.TotalBridges,
TotalBytes: state.TotalBytes,
TotalSupply: state.TotalSupply.String(),
Synced: !state.LastTime.UTC().Add(2 * time.Minute).Before(time.Now().UTC()),
}
Expand Down

0 comments on commit a8526df

Please sign in to comment.