From 9d2e24a1cefa162b6c8682406851ea3cd95c6775 Mon Sep 17 00:00:00 2001 From: istae <14264581+istae@users.noreply.github.com> Date: Mon, 31 Oct 2022 14:10:40 +0300 Subject: [PATCH] fix: staking path change (#3472) --- openapi/Swarm.yaml | 4 ++-- pkg/api/router.go | 2 +- pkg/api/staking_test.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openapi/Swarm.yaml b/openapi/Swarm.yaml index 76d6bf95c88..322f3a5ec8d 100644 --- a/openapi/Swarm.yaml +++ b/openapi/Swarm.yaml @@ -1,7 +1,7 @@ openapi: 3.0.3 info: - version: 3.2.0 + version: 3.3.0 title: Bee API description: "A list of the currently provided Interfaces to interact with the swarm, implementing file operations and sending messages" @@ -1901,7 +1901,7 @@ paths: default: description: Default response - "/stake/deposit/{amount}": + "/stake/{amount}": post: summary: Deposit some amount for staking. description: Be aware, this endpoint creates an on-chain transactions and transfers BZZ from the node's Ethereum account and hence directly manipulates the wallet balance. diff --git a/pkg/api/router.go b/pkg/api/router.go index 483e03aa620..7b7f5b56665 100644 --- a/pkg/api/router.go +++ b/pkg/api/router.go @@ -545,7 +545,7 @@ func (s *Service) mountBusinessDebug(restricted bool) { web.FinalHandlerFunc(s.healthHandler), )) - handle("/stake/deposit/{amount}", web.ChainHandlers( + handle("/stake/{amount}", web.ChainHandlers( s.stakingAccessHandler, s.gasConfigMiddleware("deposit stake"), web.FinalHandler(jsonhttp.MethodHandler{ diff --git a/pkg/api/staking_test.go b/pkg/api/staking_test.go index a3a76ea13e7..755ae789a42 100644 --- a/pkg/api/staking_test.go +++ b/pkg/api/staking_test.go @@ -24,7 +24,7 @@ func TestDepositStake(t *testing.T) { minStake := big.NewInt(100000000000000000).String() depositStake := func(amount string) string { - return fmt.Sprintf("/stake/deposit/%s", amount) + return fmt.Sprintf("/stake/%s", amount) } t.Run("ok", func(t *testing.T) { @@ -161,7 +161,7 @@ func Test_stakingDepositHandler_invalidInputs(t *testing.T) { t.Run(tc.name, func(t *testing.T) { t.Parallel() - jsonhttptest.Request(t, client, http.MethodPost, "/stake/deposit/"+tc.amount, tc.want.Code, + jsonhttptest.Request(t, client, http.MethodPost, "/stake/"+tc.amount, tc.want.Code, jsonhttptest.WithExpectedJSONResponse(tc.want), ) })