Merge pull request 'removed deprecation warnings' (#71) from deprecation-70 into main
All checks were successful
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/mntx_gateway Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
All checks were successful
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/mntx_gateway Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
Reviewed-on: #71
This commit was merged in pull request #71.
This commit is contained in:
@@ -11,7 +11,6 @@ import (
|
||||
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"
|
||||
oraclev1 "github.com/tech/sendico/pkg/proto/oracle/v1"
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
)
|
||||
@@ -171,10 +170,13 @@ func buildQuoteMeta(meta *oraclev1.RequestMeta) *model.QuoteMeta {
|
||||
}
|
||||
trace := meta.GetTrace()
|
||||
qm := &model.QuoteMeta{
|
||||
RequestRef: deriveRequestRef(meta, trace),
|
||||
TenantRef: meta.GetTenantRef(),
|
||||
TraceRef: deriveTraceRef(meta, trace),
|
||||
IdempotencyKey: deriveIdempotencyKey(meta, trace),
|
||||
TenantRef: meta.GetTenantRef(),
|
||||
}
|
||||
|
||||
if trace != nil {
|
||||
qm.RequestRef = trace.GetRequestRef()
|
||||
qm.TraceRef = trace.GetTraceRef()
|
||||
qm.IdempotencyKey = trace.GetIdempotencyKey()
|
||||
}
|
||||
if org := strings.TrimSpace(meta.GetOrganizationRef()); org != "" {
|
||||
if objID, err := primitive.ObjectIDFromHex(org); err == nil {
|
||||
@@ -201,24 +203,3 @@ func computeExpiry(now time.Time, ttlMs int64) (int64, error) {
|
||||
}
|
||||
return now.Add(time.Duration(ttlMs) * time.Millisecond).UnixMilli(), nil
|
||||
}
|
||||
|
||||
func deriveRequestRef(meta *oraclev1.RequestMeta, trace *tracev1.TraceContext) string {
|
||||
if trace != nil && trace.GetRequestRef() != "" {
|
||||
return trace.GetRequestRef()
|
||||
}
|
||||
return meta.GetRequestRef()
|
||||
}
|
||||
|
||||
func deriveTraceRef(meta *oraclev1.RequestMeta, trace *tracev1.TraceContext) string {
|
||||
if trace != nil && trace.GetTraceRef() != "" {
|
||||
return trace.GetTraceRef()
|
||||
}
|
||||
return meta.GetTraceRef()
|
||||
}
|
||||
|
||||
func deriveIdempotencyKey(meta *oraclev1.RequestMeta, trace *tracev1.TraceContext) string {
|
||||
if trace != nil && trace.GetIdempotencyKey() != "" {
|
||||
return trace.GetIdempotencyKey()
|
||||
}
|
||||
return meta.GetIdempotencyKey()
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package oracle
|
||||
import (
|
||||
"math/big"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/tech/sendico/fx/storage/model"
|
||||
"github.com/tech/sendico/pkg/decimal"
|
||||
@@ -61,7 +60,3 @@ func priceFromRate(rate *model.RateSnapshot, side fxv1.Side) (*big.Rat, error) {
|
||||
|
||||
return ratFromString(priceStr)
|
||||
}
|
||||
|
||||
func timeFromUnixMilli(ms int64) time.Time {
|
||||
return time.Unix(0, ms*int64(time.Millisecond))
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import (
|
||||
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"
|
||||
oraclev1 "github.com/tech/sendico/pkg/proto/oracle/v1"
|
||||
)
|
||||
|
||||
@@ -16,18 +15,11 @@ func buildResponseMeta(meta *oraclev1.RequestMeta) *oraclev1.ResponseMeta {
|
||||
if meta == nil {
|
||||
return resp
|
||||
}
|
||||
resp.RequestRef = meta.GetRequestRef()
|
||||
resp.TraceRef = meta.GetTraceRef()
|
||||
|
||||
trace := meta.GetTrace()
|
||||
if trace == nil {
|
||||
trace = &tracev1.TraceContext{
|
||||
RequestRef: meta.GetRequestRef(),
|
||||
IdempotencyKey: meta.GetIdempotencyKey(),
|
||||
TraceRef: meta.GetTraceRef(),
|
||||
}
|
||||
if trace != nil {
|
||||
resp.Trace = trace
|
||||
}
|
||||
resp.Trace = trace
|
||||
return resp
|
||||
}
|
||||
|
||||
|
||||
@@ -20,17 +20,18 @@ message RateSnapshot {
|
||||
}
|
||||
|
||||
message RequestMeta {
|
||||
string request_ref = 1 [deprecated = true];
|
||||
reserved 1, 4, 5;
|
||||
reserved "request_ref", "idempotency_key", "trace_ref";
|
||||
|
||||
string tenant_ref = 2;
|
||||
string organization_ref = 3;
|
||||
string idempotency_key = 4 [deprecated = true];
|
||||
string trace_ref = 5 [deprecated = true];
|
||||
common.trace.v1.TraceContext trace = 6;
|
||||
}
|
||||
|
||||
message ResponseMeta {
|
||||
string request_ref = 1 [deprecated = true];
|
||||
string trace_ref = 2 [deprecated = true];
|
||||
reserved 1, 2;
|
||||
reserved "request_ref", "trace_ref";
|
||||
|
||||
common.trace.v1.TraceContext trace = 3;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user