Skip to content

Commit

Permalink
fix: show rchash duration response in seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
martinconic committed Oct 11, 2024
1 parent 8b50ae6 commit 0f02cdc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion openapi/SwarmCommon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ components:
type: object
properties:
duration:
type: integer
type: number
hash:
$ref: "#/components/schemas/SwarmAddress"
proofs:
Expand Down
5 changes: 2 additions & 3 deletions pkg/api/rchash.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"encoding/hex"
"net/http"
"strconv"
"time"

"github.com/ethereum/go-ethereum/common"
"github.com/ethersphere/bee/v2/pkg/jsonhttp"
Expand All @@ -19,7 +18,7 @@ import (
type RCHashResponse struct {
Hash swarm.Address `json:"hash"`
Proofs ChunkInclusionProofs `json:"proofs"`
Duration time.Duration `json:"duration"`
Duration float64 `json:"duration"`
}

type ChunkInclusionProofs struct {
Expand Down Expand Up @@ -132,7 +131,7 @@ func (s *Service) rchash(w http.ResponseWriter, r *http.Request) {

resp := RCHashResponse{
Hash: swp.Hash,
Duration: swp.Duration,
Duration: swp.Duration.Seconds(),
Proofs: renderChunkInclusionProofs(swp.Proofs),
}

Expand Down

0 comments on commit 0f02cdc

Please sign in to comment.