Skip to content

Commit

Permalink
fixes after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
ascandone committed Oct 22, 2024
1 parent aa6b0ae commit 72e6de6
Show file tree
Hide file tree
Showing 8 changed files with 860 additions and 824 deletions.
1,186 changes: 618 additions & 568 deletions docs/api/README.md

Large diffs are not rendered by default.

386 changes: 193 additions & 193 deletions openapi.yaml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pkg/client/.speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: a9ac79e1-e429-4ee3-96c4-ec973f19bec3
management:
docChecksum: f87e5e30078da93c83bec4115056a7a9
docChecksum: 043615f02d6da6be8aa8e5c006587e66
docVersion: v1
speakeasyVersion: 1.351.0
generationVersion: 2.384.1
releaseVersion: 0.4.15
configChecksum: 82b92b8a70bc4a520560afe9e887834c
releaseVersion: 0.4.16
configChecksum: 87ddc5f3dd8be9290d0bf5cabd849a48
features:
go:
additionalDependencies: 0.1.0
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/.speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: true
go:
version: 0.4.15
version: 0.4.16
additionalDependencies: {}
allowUnknownFieldsInWeakUnions: false
clientServerStatusCodesAsErrors: true
Expand Down
35 changes: 19 additions & 16 deletions pkg/client/docs/models/components/v2errorsenum.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
# V2ErrorsEnum


## Values

| Name | Value |
| ------------------------------- | ------------------ |
| `V2ErrorsEnumInternal` | INTERNAL |
| `V2ErrorsEnumInsufficientFund` | INSUFFICIENT_FUND |
| `V2ErrorsEnumValidation` | VALIDATION |
| `V2ErrorsEnumConflict` | CONFLICT |
| `V2ErrorsEnumCompilationFailed` | COMPILATION_FAILED |
| `V2ErrorsEnumMetadataOverride` | METADATA_OVERRIDE |
| `V2ErrorsEnumNotFound` | NOT_FOUND |
| `V2ErrorsEnumRevertOccurring` | REVERT_OCCURRING |
| `V2ErrorsEnumAlreadyRevert` | ALREADY_REVERT |
| `V2ErrorsEnumNoPostings` | NO_POSTINGS |
| `V2ErrorsEnumLedgerNotFound` | LEDGER_NOT_FOUND |
| `V2ErrorsEnumImport` | IMPORT |
| `V2ErrorsEnumTimeout` | TIMEOUT |
| `V2ErrorsEnumBulkSizeExceeded` | BULK_SIZE_EXCEEDED |
| Name | Value |
| -------------------------------- | -------------------------------- |
| `V2ErrorsEnumInternal` | INTERNAL |
| `V2ErrorsEnumInsufficientFund` | INSUFFICIENT_FUND |
| `V2ErrorsEnumValidation` | VALIDATION |
| `V2ErrorsEnumConflict` | CONFLICT |
| `V2ErrorsEnumCompilationFailed` | COMPILATION_FAILED |
| `V2ErrorsEnumMetadataOverride` | METADATA_OVERRIDE |
| `V2ErrorsEnumNotFound` | NOT_FOUND |
| `V2ErrorsEnumRevertOccurring` | REVERT_OCCURRING |
| `V2ErrorsEnumAlreadyRevert` | ALREADY_REVERT |
| `V2ErrorsEnumNoPostings` | NO_POSTINGS |
| `V2ErrorsEnumLedgerNotFound` | LEDGER_NOT_FOUND |
| `V2ErrorsEnumImport` | IMPORT |
| `V2ErrorsEnumTimeout` | TIMEOUT |
| `V2ErrorsEnumBulkSizeExceeded` | BULK_SIZE_EXCEEDED |
| `V2ErrorsEnumInterpreterParse` | INTERPRETER_PARSE |
| `V2ErrorsEnumInterpreterRuntime` | INTERPRETER_RUNTIME |
4 changes: 2 additions & 2 deletions pkg/client/formance.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ func New(opts ...SDKOption) *Formance {
sdkConfiguration: sdkConfiguration{
Language: "go",
OpenAPIDocVersion: "v1",
SDKVersion: "0.4.15",
SDKVersion: "0.4.16",
GenVersion: "2.384.1",
UserAgent: "speakeasy-sdk/go 0.4.15 2.384.1 v1 github.com/formancehq/stack/ledger/client",
UserAgent: "speakeasy-sdk/go 0.4.16 2.384.1 v1 github.com/formancehq/stack/ledger/client",
Hooks: hooks.New(),
},
}
Expand Down
17 changes: 3 additions & 14 deletions pkg/client/models/components/v2errorsenum.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,6 @@ import (
type V2ErrorsEnum string

const (
V2ErrorsEnumInternal V2ErrorsEnum = "INTERNAL"
V2ErrorsEnumInsufficientFund V2ErrorsEnum = "INSUFFICIENT_FUND"
V2ErrorsEnumValidation V2ErrorsEnum = "VALIDATION"
V2ErrorsEnumConflict V2ErrorsEnum = "CONFLICT"
V2ErrorsEnumCompilationFailed V2ErrorsEnum = "COMPILATION_FAILED"
V2ErrorsEnumMetadataOverride V2ErrorsEnum = "METADATA_OVERRIDE"
V2ErrorsEnumNotFound V2ErrorsEnum = "NOT_FOUND"
V2ErrorsEnumRevertOccurring V2ErrorsEnum = "REVERT_OCCURRING"
V2ErrorsEnumAlreadyRevert V2ErrorsEnum = "ALREADY_REVERT"
V2ErrorsEnumNoPostings V2ErrorsEnum = "NO_POSTINGS"
V2ErrorsEnumLedgerNotFound V2ErrorsEnum = "LEDGER_NOT_FOUND"
V2ErrorsEnumImport V2ErrorsEnum = "IMPORT"
V2ErrorsEnumTimeout V2ErrorsEnum = "TIMEOUT"
V2ErrorsEnumBulkSizeExceeded V2ErrorsEnum = "BULK_SIZE_EXCEEDED"
V2ErrorsEnumInternal V2ErrorsEnum = "INTERNAL"
V2ErrorsEnumInsufficientFund V2ErrorsEnum = "INSUFFICIENT_FUND"
V2ErrorsEnumValidation V2ErrorsEnum = "VALIDATION"
Expand All @@ -36,6 +22,8 @@ const (
V2ErrorsEnumNoPostings V2ErrorsEnum = "NO_POSTINGS"
V2ErrorsEnumLedgerNotFound V2ErrorsEnum = "LEDGER_NOT_FOUND"
V2ErrorsEnumImport V2ErrorsEnum = "IMPORT"
V2ErrorsEnumTimeout V2ErrorsEnum = "TIMEOUT"
V2ErrorsEnumBulkSizeExceeded V2ErrorsEnum = "BULK_SIZE_EXCEEDED"
V2ErrorsEnumInterpreterParse V2ErrorsEnum = "INTERPRETER_PARSE"
V2ErrorsEnumInterpreterRuntime V2ErrorsEnum = "INTERPRETER_RUNTIME"
)
Expand Down Expand Up @@ -76,6 +64,7 @@ func (e *V2ErrorsEnum) UnmarshalJSON(data []byte) error {
case "TIMEOUT":
fallthrough
case "BULK_SIZE_EXCEEDED":
fallthrough
case "INTERPRETER_PARSE":
fallthrough
case "INTERPRETER_RUNTIME":
Expand Down
48 changes: 21 additions & 27 deletions test/e2e/api_bulk.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,6 @@ var _ = Context("Ledger engine tests", func() {
It("should be ok", func() {
Expect(err).To(Succeed())

tx, err := GetTransaction(ctx, testServer.GetValue(), operations.V2GetTransactionRequest{
ID: big.NewInt(1),
Ledger: "default",
})
Expect(err).To(Succeed())

tx, err := GetTransaction(ctx, testServer.GetValue(), operations.V2GetTransactionRequest{
ID: big.NewInt(1),
Ledger: "default",
Expand Down Expand Up @@ -138,27 +132,27 @@ var _ = Context("Ledger engine tests", func() {
InsertedAt: tx.InsertedAt,
}))
})
})
Context("with exceeded batch size", func() {
BeforeEach(func() {
items = make([]components.V2BulkElement, 0)
for i := 0; i < bulkMaxSize+1; i++ {
items = append(items, components.CreateV2BulkElementCreateTransaction(components.V2BulkElementCreateTransaction{
Data: &components.V2PostTransaction{
Metadata: map[string]string{},
Postings: []components.V2Posting{{
Amount: big.NewInt(100),
Asset: "USD/2",
Destination: "bank",
Source: "world",
}},
Timestamp: &now,
},
}))
}
})
It("should respond with an error", func() {
Expect(err).To(HaveErrorCode(string(components.V2ErrorsEnumBulkSizeExceeded)))
Context("with exceeded batch size", func() {
BeforeEach(func() {
items = make([]components.V2BulkElement, 0)
for i := 0; i < bulkMaxSize+1; i++ {
items = append(items, components.CreateV2BulkElementCreateTransaction(components.V2BulkElementCreateTransaction{
Data: &components.V2PostTransaction{
Metadata: map[string]string{},
Postings: []components.V2Posting{{
Amount: big.NewInt(100),
Asset: "USD/2",
Destination: "bank",
Source: "world",
}},
Timestamp: &now,
},
}))
}
})
It("should respond with an error", func() {
Expect(err).To(HaveErrorCode(string(components.V2ErrorsEnumBulkSizeExceeded)))
})
})
})
When("creating a bulk with an error on a ledger", func() {
Expand Down

0 comments on commit 72e6de6

Please sign in to comment.