fix fx/oracle compilation
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
|||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/tech/sendico/fx/storage/model"
|
"github.com/tech/sendico/fx/storage/model"
|
||||||
"github.com/tech/sendico/pkg/merrors"
|
"github.com/tech/sendico/pkg/merrors"
|
||||||
|
smodel "github.com/tech/sendico/pkg/model"
|
||||||
fxv1 "github.com/tech/sendico/pkg/proto/common/fx/v1"
|
fxv1 "github.com/tech/sendico/pkg/proto/common/fx/v1"
|
||||||
moneyv1 "github.com/tech/sendico/pkg/proto/common/money/v1"
|
moneyv1 "github.com/tech/sendico/pkg/proto/common/money/v1"
|
||||||
tracev1 "github.com/tech/sendico/pkg/proto/common/trace/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,
|
Pair: qc.pair.Pair,
|
||||||
Side: qc.sideModel,
|
Side: qc.sideModel,
|
||||||
Price: formatRat(qc.priceRounded, qc.priceScale),
|
Price: formatRat(qc.priceRounded, qc.priceScale),
|
||||||
BaseAmount: model.Money{
|
BaseAmount: smodel.Money{
|
||||||
Currency: qc.pair.Pair.Base,
|
Currency: qc.pair.Pair.Base,
|
||||||
Amount: formatRat(qc.baseRounded, qc.baseScale),
|
Amount: formatRat(qc.baseRounded, qc.baseScale),
|
||||||
},
|
},
|
||||||
QuoteAmount: model.Money{
|
QuoteAmount: smodel.Money{
|
||||||
Currency: qc.pair.Pair.Quote,
|
Currency: qc.pair.Pair.Quote,
|
||||||
Amount: formatRat(qc.quoteRounded, qc.quoteScale),
|
Amount: formatRat(qc.quoteRounded, qc.quoteScale),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import (
|
|||||||
"github.com/tech/sendico/fx/storage"
|
"github.com/tech/sendico/fx/storage"
|
||||||
"github.com/tech/sendico/fx/storage/model"
|
"github.com/tech/sendico/fx/storage/model"
|
||||||
"github.com/tech/sendico/pkg/merrors"
|
"github.com/tech/sendico/pkg/merrors"
|
||||||
|
smodel "github.com/tech/sendico/pkg/model"
|
||||||
fxv1 "github.com/tech/sendico/pkg/proto/common/fx/v1"
|
fxv1 "github.com/tech/sendico/pkg/proto/common/fx/v1"
|
||||||
moneyv1 "github.com/tech/sendico/pkg/proto/common/money/v1"
|
moneyv1 "github.com/tech/sendico/pkg/proto/common/money/v1"
|
||||||
tracev1 "github.com/tech/sendico/pkg/proto/common/trace/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"},
|
Pair: model.CurrencyPair{Base: "USD", Quote: "EUR"},
|
||||||
Side: model.QuoteSideBuyBaseSellQuote,
|
Side: model.QuoteSideBuyBaseSellQuote,
|
||||||
Price: "1.10",
|
Price: "1.10",
|
||||||
BaseAmount: model.Money{Currency: "USD", Amount: "100"},
|
BaseAmount: smodel.Money{Currency: "USD", Amount: "100"},
|
||||||
QuoteAmount: model.Money{Currency: "EUR", Amount: "110"},
|
QuoteAmount: smodel.Money{Currency: "EUR", Amount: "110"},
|
||||||
ExpiresAtUnixMs: now.UnixMilli(),
|
ExpiresAtUnixMs: now.UnixMilli(),
|
||||||
Status: model.QuoteStatusIssued,
|
Status: model.QuoteStatusIssued,
|
||||||
}, nil
|
}, nil
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/tech/sendico/fx/storage/model"
|
"github.com/tech/sendico/fx/storage/model"
|
||||||
|
smodel "github.com/tech/sendico/pkg/model"
|
||||||
fxv1 "github.com/tech/sendico/pkg/proto/common/fx/v1"
|
fxv1 "github.com/tech/sendico/pkg/proto/common/fx/v1"
|
||||||
moneyv1 "github.com/tech/sendico/pkg/proto/common/money/v1"
|
moneyv1 "github.com/tech/sendico/pkg/proto/common/money/v1"
|
||||||
tracev1 "github.com/tech/sendico/pkg/proto/common/trace/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 {
|
if m == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user