Merge pull request 'fix fx/oracle compilation' (#68) from bug-66 into main
Some checks failed
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/chain_gateway Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/nats Pipeline failed
ci/woodpecker/push/mntx_gateway Pipeline failed
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful

Reviewed-on: #68
This commit was merged in pull request #68.
This commit is contained in:
2025-12-11 09:36:50 +00:00
3 changed files with 8 additions and 5 deletions

View File

@@ -8,6 +8,7 @@ import (
"github.com/google/uuid"
"github.com/tech/sendico/fx/storage/model"
"github.com/tech/sendico/pkg/merrors"
smodel "github.com/tech/sendico/pkg/model"
fxv1 "github.com/tech/sendico/pkg/proto/common/fx/v1"
moneyv1 "github.com/tech/sendico/pkg/proto/common/money/v1"
tracev1 "github.com/tech/sendico/pkg/proto/common/trace/v1"
@@ -138,11 +139,11 @@ func (qc *quoteComputation) buildModelQuote(firm bool, expiryMillis int64, req *
Pair: qc.pair.Pair,
Side: qc.sideModel,
Price: formatRat(qc.priceRounded, qc.priceScale),
BaseAmount: model.Money{
BaseAmount: smodel.Money{
Currency: qc.pair.Pair.Base,
Amount: formatRat(qc.baseRounded, qc.baseScale),
},
QuoteAmount: model.Money{
QuoteAmount: smodel.Money{
Currency: qc.pair.Pair.Quote,
Amount: formatRat(qc.quoteRounded, qc.quoteScale),
},

View File

@@ -9,6 +9,7 @@ import (
"github.com/tech/sendico/fx/storage"
"github.com/tech/sendico/fx/storage/model"
"github.com/tech/sendico/pkg/merrors"
smodel "github.com/tech/sendico/pkg/model"
fxv1 "github.com/tech/sendico/pkg/proto/common/fx/v1"
moneyv1 "github.com/tech/sendico/pkg/proto/common/money/v1"
tracev1 "github.com/tech/sendico/pkg/proto/common/trace/v1"
@@ -381,8 +382,8 @@ func TestServiceValidateQuote(t *testing.T) {
Pair: model.CurrencyPair{Base: "USD", Quote: "EUR"},
Side: model.QuoteSideBuyBaseSellQuote,
Price: "1.10",
BaseAmount: model.Money{Currency: "USD", Amount: "100"},
QuoteAmount: model.Money{Currency: "EUR", Amount: "110"},
BaseAmount: smodel.Money{Currency: "USD", Amount: "100"},
QuoteAmount: smodel.Money{Currency: "EUR", Amount: "110"},
ExpiresAtUnixMs: now.UnixMilli(),
Status: model.QuoteStatusIssued,
}, nil

View File

@@ -4,6 +4,7 @@ import (
"strings"
"github.com/tech/sendico/fx/storage/model"
smodel "github.com/tech/sendico/pkg/model"
fxv1 "github.com/tech/sendico/pkg/proto/common/fx/v1"
moneyv1 "github.com/tech/sendico/pkg/proto/common/money/v1"
tracev1 "github.com/tech/sendico/pkg/proto/common/trace/v1"
@@ -49,7 +50,7 @@ func quoteModelToProto(q *model.Quote) *oraclev1.Quote {
}
}
func moneyModelToProto(m *model.Money) *moneyv1.Money {
func moneyModelToProto(m *smodel.Money) *moneyv1.Money {
if m == nil {
return nil
}