Skip to content

Commit

Permalink
api: remove API.RouterHandler method
Browse files Browse the repository at this point in the history
The field was already exposed and used by other packages.
  • Loading branch information
mvdan committed Jan 2, 2024
1 parent 97802d4 commit 5eaeb58
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
5 changes: 0 additions & 5 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,6 @@ func (a *API) Attach(vocdoniAPP *vochain.BaseApplication, vocdoniInfo *vochainin
a.censusdb = censusdb
}

// RouterHandler returns the API router handler which can be used to register new custom endpoints.
func (a *API) RouterHandler() *apirest.API {
return a.Endpoint
}

// EnableHandlers enables the list of handlers. Attach must be called before.
func (a *API) EnableHandlers(handlers ...string) error {
for _, h := range handlers {
Expand Down
2 changes: 1 addition & 1 deletion cmd/node/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ func main() {
if conf.EnableFaucetWithAmount > 0 {
if err := faucet.AttachFaucetAPI(srv.Signer,
conf.EnableFaucetWithAmount,
uAPI.RouterHandler(),
uAPI.Endpoint,
"/open/claim",
); err != nil {
log.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion cmd/voconed/voconed.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func main() {
log.Infof("faucet account %s, faucet amount %d", faucetAccount.Address().Hex(), config.enableFaucetWithAmount)
if err := faucet.AttachFaucetAPI(&faucetAccount,
config.enableFaucetWithAmount,
uAPI.RouterHandler(),
uAPI.Endpoint,
"/open/claim",
); err != nil {
log.Fatal(err)
Expand Down

0 comments on commit 5eaeb58

Please sign in to comment.