From 1d48cd3f0ec4676c2339ba1da3be830c0885b6a3 Mon Sep 17 00:00:00 2001 From: tony Date: Fri, 20 Dec 2024 16:44:52 +0800 Subject: [PATCH] minor naming --- api/accounts/accounts.go | 8 ++++---- api/subscriptions/subscriptions.go | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/api/accounts/accounts.go b/api/accounts/accounts.go index 7e325f0de..4e78e8711 100644 --- a/api/accounts/accounts.go +++ b/api/accounts/accounts.go @@ -377,16 +377,16 @@ func (a *Accounts) Mount(root *mux.Router, pathPrefix string) { HandlerFunc(utils.WrapHandlerFunc(a.handleGetStorage)) // These two methods are currently deprecated - deprecatedHandler := utils.HandleGone + callContractHandler := utils.HandleGone if a.enabledDeprecated { - deprecatedHandler = a.handleCallContract + callContractHandler = a.handleCallContract } sub.Path(""). Methods(http.MethodPost). Name("POST /accounts"). - HandlerFunc(utils.WrapHandlerFunc(deprecatedHandler)) + HandlerFunc(utils.WrapHandlerFunc(callContractHandler)) sub.Path("/{address}"). Methods(http.MethodPost). Name("POST /accounts/{address}"). - HandlerFunc(utils.WrapHandlerFunc(deprecatedHandler)) + HandlerFunc(utils.WrapHandlerFunc(callContractHandler)) } diff --git a/api/subscriptions/subscriptions.go b/api/subscriptions/subscriptions.go index 33b8a3b59..59f6708ad 100644 --- a/api/subscriptions/subscriptions.go +++ b/api/subscriptions/subscriptions.go @@ -379,36 +379,36 @@ func (s *Subscriptions) Mount(root *mux.Router, pathPrefix string) { sub.Path("/txpool"). Methods(http.MethodGet). - Name("WS /subscriptions/txpool"). + Name("WS /subscriptions/txpool"). // metrics middleware relies on this name HandlerFunc(utils.WrapHandlerFunc(s.handlePendingTransactions)) sub.Path("/block"). Methods(http.MethodGet). - Name("WS /subscriptions/block"). + Name("WS /subscriptions/block"). // metrics middleware relies on this name HandlerFunc(utils.WrapHandlerFunc(s.websocket(s.handleBlockReader))) sub.Path("/event"). Methods(http.MethodGet). - Name("WS /subscriptions/event"). + Name("WS /subscriptions/event"). // metrics middleware relies on this name HandlerFunc(utils.WrapHandlerFunc(s.websocket(s.handleEventReader))) sub.Path("/transfer"). Methods(http.MethodGet). - Name("WS /subscriptions/transfer"). + Name("WS /subscriptions/transfer"). // metrics middleware relies on this name HandlerFunc(utils.WrapHandlerFunc(s.websocket(s.handleTransferReader))) sub.Path("/beat2"). Methods(http.MethodGet). - Name("WS /subscriptions/beat2"). + Name("WS /subscriptions/beat2"). // metrics middleware relies on this name HandlerFunc(utils.WrapHandlerFunc(s.websocket(s.handleBeat2Reader))) // This method is currently deprecated - deprecatedBeatHandler := utils.HandleGone + beatHandler := utils.HandleGone if s.enabledDeprecated { - deprecatedBeatHandler = s.websocket(s.handleBeatReader) + beatHandler = s.websocket(s.handleBeatReader) } sub.Path("/beat"). Methods(http.MethodGet). - Name("WS /subscriptions/beat"). - HandlerFunc(utils.WrapHandlerFunc(deprecatedBeatHandler)) + Name("WS /subscriptions/beat"). // metrics middleware relies on this name + HandlerFunc(utils.WrapHandlerFunc(beatHandler)) }