Skip to content

Commit

Permalink
Merge branch 'master' of github.com:celenium-io/celestia-indexer into…
Browse files Browse the repository at this point in the history
… fix/ws
  • Loading branch information
vvuwei committed Oct 31, 2023
2 parents f4742f7 + 63e3afb commit 736eee9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
8 changes: 5 additions & 3 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.

5 changes: 4 additions & 1 deletion cmd/api/handler/responses/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ package responses

import (
"encoding/hex"
pkgTypes "github.com/celenium-io/celestia-indexer/pkg/types"
"time"

pkgTypes "github.com/celenium-io/celestia-indexer/pkg/types"

"github.com/celenium-io/celestia-indexer/internal/storage"
)

Expand All @@ -22,6 +23,7 @@ type State struct {
TotalFee string `example:"312" format:"string" json:"total_fee" swaggertype:"string"`
TotalBlobsSize int64 `example:"56789" format:"int64" json:"total_blobs_size" swaggertype:"integer"`
TotalSupply string `example:"312" format:"string" json:"total_supply" swaggertype:"string"`
Synced bool `example:"true" format:"boolean" json:"synced" swaggertype:"boolean"`
}

func NewState(state storage.State) State {
Expand All @@ -36,5 +38,6 @@ func NewState(state storage.State) State {
TotalFee: state.TotalFee.String(),
TotalBlobsSize: state.TotalBlobsSize,
TotalSupply: state.TotalSupply.String(),
Synced: !state.LastTime.UTC().Add(2 * time.Minute).Before(time.Now().UTC()),
}
}

0 comments on commit 736eee9

Please sign in to comment.