Skip to content

Commit

Permalink
refacto: add bulker
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag committed Nov 22, 2024
1 parent e5abb9c commit 50a5eb7
Show file tree
Hide file tree
Showing 29 changed files with 688 additions and 630 deletions.
7 changes: 4 additions & 3 deletions internal/api/common/mocks_ledger_controller_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/api/v1/controllers_transactions_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func createTransaction(w http.ResponseWriter, r *http.Request) {
Metadata: payload.Metadata,
}

_, res, err := l.CreateTransaction(r.Context(), getCommandParameters(r, common.TxToScriptData(txData, false)))
_, res, err := l.CreateTransaction(r.Context(), getCommandParameters(r, ledgercontroller.TxToScriptData(txData, false)))
if err != nil {
switch {
case errors.Is(err, &ledgercontroller.ErrInsufficientFunds{}):
Expand Down
5 changes: 2 additions & 3 deletions internal/api/v1/controllers_transactions_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package v1

import (
"encoding/json"
"github.com/formancehq/ledger/internal/api/common"
"math/big"
"net/http"
"net/http/httptest"
Expand Down Expand Up @@ -154,7 +153,7 @@ func TestTransactionsCreate(t *testing.T) {
ledger.NewPosting("world", "bank", "USD", big.NewInt(100)),
},
},
expectedRunScript: common.TxToScriptData(ledger.NewTransactionData().WithPostings(
expectedRunScript: ledgercontroller.TxToScriptData(ledger.NewTransactionData().WithPostings(
ledger.NewPosting("world", "bank", "USD", big.NewInt(100)),
), false),
},
Expand All @@ -169,7 +168,7 @@ func TestTransactionsCreate(t *testing.T) {
},
},
expectedPreview: true,
expectedRunScript: common.TxToScriptData(ledger.NewTransactionData().WithPostings(
expectedRunScript: ledgercontroller.TxToScriptData(ledger.NewTransactionData().WithPostings(
ledger.NewPosting("world", "bank", "USD", big.NewInt(100)),
), false),
},
Expand Down
7 changes: 4 additions & 3 deletions internal/api/v1/mocks_ledger_controller_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 50a5eb7

Please sign in to comment.