Skip to content

Commit

Permalink
Merge branch 'fix/sdk-generation' into fix/sdk
Browse files Browse the repository at this point in the history
Signed-off-by: Ragot Geoffrey <[email protected]>
  • Loading branch information
gfyrag authored Feb 24, 2023
2 parents 3c23651 + e06520c commit 3b857df
Show file tree
Hide file tree
Showing 12 changed files with 7 additions and 544 deletions.
2 changes: 1 addition & 1 deletion Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ tasks:
cmds:
- cp ../pkg/api/controllers/swagger.yaml .
- sed -i -e "s/LEDGER_VERSION/{{.VERSION}}/g" swagger.yaml
- rm -rf ./sdks/{{.CLI_ARGS}}
- rm -rf ./sdks/{{.CLI_ARGS}}/*
- >
docker run --rm -w /local -v ${PWD}:/local openapitools/openapi-generator-cli:v6.4.0 generate
-i ./swagger.yaml
Expand Down
3 changes: 1 addition & 2 deletions pkg/ledger/execute_script.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func (l *Ledger) ExecuteScript(ctx context.Context, preview bool, script core.Sc
}

vAggr := NewVolumeAggregator(l)
txs := make([]core.ExpandedTransaction, 0)
var nextTxId uint64
if lastTx != nil {
nextTxId = lastTx.ID + 1
Expand Down Expand Up @@ -291,7 +290,7 @@ func (l *Ledger) ExecuteScript(ctx context.Context, preview bool, script core.Sc
}
}

l.monitor.CommittedTransactions(ctx, l.store.Name(), txs...)
l.monitor.CommittedTransactions(ctx, l.store.Name(), tx)
if addOps != nil && addOps.SetAccountMeta != nil {
for addr, m := range addOps.SetAccountMeta {
l.monitor.SavedMetadata(ctx,
Expand Down
5 changes: 5 additions & 0 deletions pkg/storage/sqlstorage/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"database/sql"
"database/sql/driver"
"fmt"
"sync"

"github.com/formancehq/go-libs/logging"
"github.com/huandu/go-sqlbuilder"
Expand Down Expand Up @@ -102,6 +103,7 @@ type Driver struct {
db DB
systemSchema Schema
registeredLedgers map[string]struct{}
lock sync.Mutex
}

func (d *Driver) GetSystemStore() storage.SystemStore {
Expand All @@ -118,6 +120,9 @@ func (d *Driver) GetLedgerStore(ctx context.Context, name string, create bool) (
ctx, span := opentelemetry.Start(ctx, "Load store")
defer span.End()

d.lock.Lock()
defer d.lock.Unlock()

var (
created bool
schema Schema
Expand Down
2 changes: 0 additions & 2 deletions sdk/configs/typescript-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,3 @@ additionalProperties:
files:
Taskfile.yml.mustache:
destinationFilename: Taskfile.yml
.github/workflows/release.yml.mustache:
destinationFilename: .github/workflows/release.yml
231 changes: 0 additions & 231 deletions sdk/templates/go/README.mustache

This file was deleted.

Loading

0 comments on commit 3b857df

Please sign in to comment.