Skip to content

Commit

Permalink
Merge branch 'pedro/tweak_subscriptions' of github.com:vechain/thor i…
Browse files Browse the repository at this point in the history
…nto pedro/tweak_subscriptions
  • Loading branch information
otherview committed Dec 20, 2024
2 parents 3cd601d + 1d48cd3 commit 3558bd5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions api/accounts/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
18 changes: 9 additions & 9 deletions api/subscriptions/subscriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,36 +372,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))
}

0 comments on commit 3558bd5

Please sign in to comment.