fix fx/oracle compilation

This commit is contained in:
Stephan D
2025-12-11 10:36:31 +01:00
parent 779cb0ead9
commit 8e40e6247b
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
}