mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-05 22:48:36 +00:00
Remove unrequired big int conversion
This commit is contained in:
parent
2ee7728d7d
commit
be217124cb
2 changed files with 6 additions and 6 deletions
|
|
@ -29,10 +29,10 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
type requestBody struct {
|
type requestBody struct {
|
||||||
Synced *bool `json:"synced"`
|
Synced *bool `json:"synced"`
|
||||||
MinPeerCount *uint `json:"min_peer_count"`
|
MinPeerCount *uint `json:"min_peer_count"`
|
||||||
CheckBlock *uint64 `json:"check_block"`
|
CheckBlock *big.Int `json:"check_block"`
|
||||||
MaxSecondsBehind *int `json:"max_seconds_behind"`
|
MaxSecondsBehind *int `json:"max_seconds_behind"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// processFromHeaders handles requests when 'X-GETH-HEALTHCHECK' header labels are present.
|
// processFromHeaders handles requests when 'X-GETH-HEALTHCHECK' header labels are present.
|
||||||
|
|
@ -105,7 +105,7 @@ func processFromBody(ec ethClient, w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if body.CheckBlock != nil {
|
if body.CheckBlock != nil {
|
||||||
errCheckBlock = checkBlockNumber(ec, big.NewInt(int64(*body.CheckBlock)))
|
errCheckBlock = checkBlockNumber(ec, body.CheckBlock)
|
||||||
}
|
}
|
||||||
|
|
||||||
if body.MaxSecondsBehind != nil {
|
if body.MaxSecondsBehind != nil {
|
||||||
|
|
|
||||||
|
|
@ -585,7 +585,7 @@ func TestProcessFromBody(t *testing.T) {
|
||||||
clientSyncingError: nil,
|
clientSyncingError: nil,
|
||||||
expectedStatusCode: http.StatusInternalServerError,
|
expectedStatusCode: http.StatusInternalServerError,
|
||||||
expectedBody: map[string]string{
|
expectedBody: map[string]string{
|
||||||
query: "ERROR: json: cannot unmarshal string into Go struct field requestBody.check_block of type uint64",
|
query: "ERROR: math/big: cannot unmarshal \"\\\"ABC\\\"\" into a *big.Int",
|
||||||
synced: "DISABLED",
|
synced: "DISABLED",
|
||||||
minPeerCount: "DISABLED",
|
minPeerCount: "DISABLED",
|
||||||
checkBlock: "DISABLED",
|
checkBlock: "DISABLED",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue