Skip to content

Commit

Permalink
chore: move core in ledger/pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag committed Sep 23, 2024
1 parent 5f4c416 commit c10a388
Show file tree
Hide file tree
Showing 22 changed files with 15 additions and 120 deletions.
2 changes: 0 additions & 2 deletions components/ledger/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ IMPORT .. AS components
FROM core+base-image

sources:
WORKDIR src
COPY (stack+sources/out --LOCATION=libs/core) /src/libs/core
WORKDIR /src/components/ledger
COPY go.mod go.sum .
COPY --dir internal pkg cmd .
Expand Down
3 changes: 0 additions & 3 deletions components/ledger/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@ toolchain go1.22.7

replace github.com/formancehq/stack/ledger/client => ./pkg/client

replace github.com/formancehq/stack/libs/core => ../../libs/core

require (
github.com/ThreeDotsLabs/watermill v1.3.7
github.com/alitto/pond v1.9.2
github.com/antlr/antlr4/runtime/Go/antlr v1.4.10
github.com/bluele/gcache v0.0.2
github.com/formancehq/go-libs v1.7.1
github.com/formancehq/stack/ledger/client v0.0.0-00010101000000-000000000000
github.com/formancehq/stack/libs/core v0.0.0-00010101000000-000000000000
github.com/go-chi/chi/v5 v5.1.0
github.com/go-chi/cors v1.2.1
github.com/google/go-cmp v0.6.0
Expand Down
3 changes: 2 additions & 1 deletion components/ledger/internal/api/v1/controllers_accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ import (
"strconv"
"strings"

"github.com/formancehq/ledger/pkg/core/accounts"

"github.com/go-chi/chi/v5"

storageerrors "github.com/formancehq/ledger/internal/storage/sqlutils"

"github.com/formancehq/go-libs/pointer"
"github.com/formancehq/stack/libs/core/accounts"

"github.com/formancehq/go-libs/bun/bunpaginate"
"github.com/formancehq/ledger/internal/api/backend"
Expand Down
3 changes: 2 additions & 1 deletion components/ledger/internal/api/v2/controllers_accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import (
"net/http"
"net/url"

"github.com/formancehq/ledger/pkg/core/accounts"

"github.com/go-chi/chi/v5"

storageerrors "github.com/formancehq/ledger/internal/storage/sqlutils"

"github.com/formancehq/go-libs/pointer"
"github.com/formancehq/stack/libs/core/accounts"

sharedapi "github.com/formancehq/go-libs/api"
"github.com/formancehq/go-libs/bun/bunpaginate"
Expand Down
2 changes: 1 addition & 1 deletion components/ledger/internal/machine/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package machine
import (
"fmt"

"github.com/formancehq/stack/libs/core/accounts"
"github.com/formancehq/ledger/pkg/core/accounts"
)

type AccountAddress string
Expand Down
2 changes: 1 addition & 1 deletion components/ledger/internal/machine/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package machine
import (
"fmt"

"github.com/formancehq/stack/libs/core/assets"
"github.com/formancehq/ledger/pkg/core/assets"
)

type Asset string
Expand Down
4 changes: 2 additions & 2 deletions components/ledger/internal/posting.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"encoding/json"
"math/big"

"github.com/formancehq/stack/libs/core/accounts"
"github.com/formancehq/stack/libs/core/assets"
"github.com/formancehq/ledger/pkg/core/accounts"
"github.com/formancehq/ledger/pkg/core/assets"

"github.com/pkg/errors"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions components/payments/internal/storage/migrations_v1.x.go
Original file line number Diff line number Diff line change
Expand Up @@ -1052,8 +1052,6 @@ func fixExpandingChangelogs(ctx context.Context, tx bun.Tx) error {
return err
}

fmt.Println("Processing", len(metadata), "metadata")

if len(metadata) == 0 {
break
}
Expand Down
2 changes: 1 addition & 1 deletion ee/wallets/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ FROM core+base-image

sources:
WORKDIR src
COPY (stack+sources/out --LOCATION=libs/core) libs/core
COPY (stack+sources/out --LOCATION=components/ledger) components/ledger
COPY --pass-args (releases+sdk-generate/go) /src/releases/sdks/go
WORKDIR /src/ee/wallets
COPY go.* .
Expand Down
6 changes: 3 additions & 3 deletions ee/wallets/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toolchain go1.22.7
require (
github.com/formancehq/formance-sdk-go/v2 v2.0.0-00010101000000-000000000000
github.com/formancehq/go-libs v1.7.1
github.com/formancehq/stack/libs/core v0.0.0-00010101000000-000000000000
github.com/formancehq/ledger v0.0.0-00010101000000-000000000000
github.com/go-chi/chi/v5 v5.1.0
github.com/go-chi/render v1.0.3
github.com/google/uuid v1.6.0
Expand Down Expand Up @@ -89,6 +89,6 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/formancehq/stack/libs/core => ../../libs/core

replace github.com/formancehq/formance-sdk-go/v2 => ../../releases/sdks/go

replace github.com/formancehq/ledger => ../../components/ledger
2 changes: 1 addition & 1 deletion ee/wallets/pkg/credit.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"math/big"
"net/http"

"github.com/formancehq/stack/libs/core/assets"
"github.com/formancehq/ledger/pkg/core/assets"

"github.com/formancehq/go-libs/time"

Expand Down
3 changes: 1 addition & 2 deletions ee/wallets/pkg/debit.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import (
"math/big"
"net/http"

"github.com/formancehq/stack/libs/core/assets"

"github.com/formancehq/ledger/pkg/core/assets"
"github.com/formancehq/go-libs/time"

"github.com/formancehq/go-libs/metadata"
Expand Down
2 changes: 1 addition & 1 deletion ee/wallets/pkg/subject.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package wallet
import (
"fmt"

"github.com/formancehq/stack/libs/core/accounts"
"github.com/formancehq/ledger/pkg/core/accounts"
)

const (
Expand Down
1 change: 0 additions & 1 deletion libs/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ IMPORT .. AS stack
run:
LOCALLY
ARG --required TARGET
BUILD ./core+$TARGET
BUILD ./events+$TARGET
43 changes: 0 additions & 43 deletions libs/core/.golangci.yml

This file was deleted.

32 changes: 0 additions & 32 deletions libs/core/Earthfile

This file was deleted.

11 changes: 0 additions & 11 deletions libs/core/go.mod

This file was deleted.

10 changes: 0 additions & 10 deletions libs/core/go.sum

This file was deleted.

2 changes: 0 additions & 2 deletions tests/integration/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ require (
github.com/fatih/structs v1.1.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/formancehq/payments/genericclient v0.0.0-00010101000000-000000000000 // indirect
github.com/formancehq/stack/libs/core v0.0.0-00010101000000-000000000000 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/get-momo/atlar-v1-go-client v1.2.1 // indirect
github.com/gibson042/canonicaljson-go v1.0.3 // indirect
Expand Down Expand Up @@ -280,7 +279,6 @@ replace (
github.com/formancehq/payments/genericclient => ../../components/payments/cmd/connectors/internal/connectors/generic/client/generated
github.com/formancehq/reconciliation => ../../ee/reconciliation
github.com/formancehq/search => ../../ee/search
github.com/formancehq/stack/libs/core => ../../libs/core
github.com/formancehq/stack/libs/events => ../../libs/events
github.com/formancehq/wallets => ../../ee/wallets
github.com/formancehq/webhooks => ../../ee/webhooks
Expand Down

0 comments on commit c10a388

Please sign in to comment.