diff --git a/openapi/SwarmCommon.yaml b/openapi/SwarmCommon.yaml index 7f309582cf..929842764e 100644 --- a/openapi/SwarmCommon.yaml +++ b/openapi/SwarmCommon.yaml @@ -1016,7 +1016,7 @@ components: type: object properties: duration: - type: integer + type: number hash: $ref: "#/components/schemas/SwarmAddress" proofs: diff --git a/pkg/api/rchash.go b/pkg/api/rchash.go index 3aec3e3836..24fe803ed4 100644 --- a/pkg/api/rchash.go +++ b/pkg/api/rchash.go @@ -7,7 +7,6 @@ import ( "encoding/hex" "net/http" "strconv" - "time" "github.com/ethereum/go-ethereum/common" "github.com/ethersphere/bee/v2/pkg/jsonhttp" @@ -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 { @@ -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), }