rpc: make all handler have the same signature

This commit is contained in:
Evgenii Stratonikov 2020-03-13 10:26:29 +03:00
parent 6e801d33f0
commit 8236217a01

View file

@ -189,7 +189,7 @@ func (s *Server) methodHandler(w http.ResponseWriter, req *request.In, reqParams
case "getnep5transfers": case "getnep5transfers":
results, resultsErr = s.getNEP5Transfers(reqParams) results, resultsErr = s.getNEP5Transfers(reqParams)
case "getvalidators": case "getvalidators":
results, resultsErr = s.getValidators() results, resultsErr = s.getValidators(reqParams)
case "getversion": case "getversion":
results, resultsErr = s.getVersion(reqParams) results, resultsErr = s.getVersion(reqParams)
@ -769,7 +769,7 @@ func (s *Server) getAccountStateAux(reqParams request.Params, unspents bool) (in
} }
// getBlockSysFee returns the system fees of the block, based on the specified index. // getBlockSysFee returns the system fees of the block, based on the specified index.
func (s *Server) getBlockSysFee(reqParams request.Params) (util.Fixed8, error) { func (s *Server) getBlockSysFee(reqParams request.Params) (interface{}, error) {
param, ok := reqParams.ValueWithType(0, request.NumberT) param, ok := reqParams.ValueWithType(0, request.NumberT)
if !ok { if !ok {
return 0, response.ErrInvalidParams return 0, response.ErrInvalidParams
@ -853,7 +853,7 @@ func (s *Server) getUnclaimed(ps request.Params) (interface{}, error) {
} }
// getValidators returns the current NEO consensus nodes information and voting status. // getValidators returns the current NEO consensus nodes information and voting status.
func (s *Server) getValidators() (interface{}, error) { func (s *Server) getValidators(_ request.Params) (interface{}, error) {
var validators keys.PublicKeys var validators keys.PublicKeys
validators, err := s.chain.GetValidators() validators, err := s.chain.GetValidators()