http endpoint cleanup (#13432)

Co-authored-by: Radosław Kapka <rkapka@wp.pl>
This commit is contained in:
psr 2024-01-10 05:18:43 +05:30 committed by GitHub
parent 98e3f2b80f
commit 4fe6834ba5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,6 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/gorilla/mux"
"github.com/pkg/errors"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/shared"
fieldparams "github.com/prysmaticlabs/prysm/v4/config/fieldparams"
@ -705,14 +704,8 @@ func (s *Server) GetGasLimit(w http.ResponseWriter, r *http.Request) {
return
}
rawPubkey := mux.Vars(r)["pubkey"]
if rawPubkey == "" {
httputil.HandleError(w, "pubkey is required in URL params", http.StatusBadRequest)
return
}
pubkey, valid := shared.ValidateHex(w, "pubkey", rawPubkey, fieldparams.BLSPubkeyLength)
if !valid {
rawPubkey, pubkey, ok := shared.HexFromRoute(w, r, "pubkey", fieldparams.BLSPubkeyLength)
if !ok {
return
}