diff --git a/internal/delivery/http/transfer.go b/internal/delivery/http/transfer.go index fcf08ea..cae9cf2 100644 --- a/internal/delivery/http/transfer.go +++ b/internal/delivery/http/transfer.go @@ -43,7 +43,7 @@ func (handler *Handler) createTransfer(ctx *gin.Context) { Amount: req.Amount, } - account, err := handler.Store.TransferTxAccount(ctx, arg) + account, err := handler.Store.TransferTx(ctx, arg) if err != nil { ctx.JSON(http.StatusInternalServerError, errorResponse(err)) return diff --git a/internal/delivery/http/transfer_test.go b/internal/delivery/http/transfer_test.go index 19d4eba..9c4ecfd 100644 --- a/internal/delivery/http/transfer_test.go +++ b/internal/delivery/http/transfer_test.go @@ -91,7 +91,7 @@ func TestServer_createTransfer(t *testing.T) { Return(toAccount, nil) store.EXPECT(). - TransferTxAccount(gomock.Any(), gomock.Eq(db.TransferTxParams{ + TransferTx(gomock.Any(), gomock.Eq(db.TransferTxParams{ FromAccountID: fromAccount.ID, ToAccountID: toAccount.ID, Amount: amount, @@ -120,7 +120,7 @@ func TestServer_createTransfer(t *testing.T) { }, buildStubs: func(store *mockdb.MockStore) { store.EXPECT(). - TransferTxAccount(gomock.Any(), gomock.Any()). + TransferTx(gomock.Any(), gomock.Any()). Times(0) }, checkResponse: func(t *testing.T, recorder *httptest.ResponseRecorder) { @@ -142,7 +142,7 @@ func TestServer_createTransfer(t *testing.T) { Return(db.Account{}, sql.ErrNoRows) store.EXPECT(). - TransferTxAccount(gomock.Any(), gomock.Any()). + TransferTx(gomock.Any(), gomock.Any()). Times(0) }, checkResponse: func(t *testing.T, recorder *httptest.ResponseRecorder) { @@ -164,7 +164,7 @@ func TestServer_createTransfer(t *testing.T) { Return(fromAccount, nil) store.EXPECT(). - TransferTxAccount(gomock.Any(), gomock.Any()). + TransferTx(gomock.Any(), gomock.Any()). Times(0) }, checkResponse: func(t *testing.T, recorder *httptest.ResponseRecorder) { @@ -191,7 +191,7 @@ func TestServer_createTransfer(t *testing.T) { Return(thirdAccount, nil) store.EXPECT(). - TransferTxAccount(gomock.Any(), gomock.Any()). + TransferTx(gomock.Any(), gomock.Any()). Times(0) }, checkResponse: func(t *testing.T, recorder *httptest.ResponseRecorder) { @@ -217,7 +217,7 @@ func TestServer_createTransfer(t *testing.T) { Times(0) store.EXPECT(). - TransferTxAccount(gomock.Any(), gomock.Eq(db.TransferTxParams{ + TransferTx(gomock.Any(), gomock.Eq(db.TransferTxParams{ FromAccountID: fromAccount.ID, ToAccountID: toAccount.ID, Amount: amount, @@ -228,7 +228,7 @@ func TestServer_createTransfer(t *testing.T) { }, }, { - name: "500 Internal server error from TransferTxAccount", + name: "500 Internal server error from TransferTx", body: gin.H{ "from_account_id": fromAccount.ID, "to_account_id": toAccount.ID, @@ -247,7 +247,7 @@ func TestServer_createTransfer(t *testing.T) { Return(toAccount, nil) store.EXPECT(). - TransferTxAccount(gomock.Any(), gomock.Eq(db.TransferTxParams{ + TransferTx(gomock.Any(), gomock.Eq(db.TransferTxParams{ FromAccountID: fromAccount.ID, ToAccountID: toAccount.ID, Amount: amount,