Skip to content

Commit 8ef7584

Browse files
authored
Merge pull request #929 from lightninglabs/tapd-migrate-library
mod: add replace directive to compile tapd
2 parents 2bc5df2 + 0591865 commit 8ef7584

File tree

5 files changed

+54
-60
lines changed

5 files changed

+54
-60
lines changed

assets/client.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010

1111
"github.com/btcsuite/btcd/btcutil"
1212
"github.com/lightninglabs/taproot-assets/rfqmath"
13+
"github.com/lightninglabs/taproot-assets/rpcutils"
1314
"github.com/lightninglabs/taproot-assets/tapcfg"
1415
"github.com/lightninglabs/taproot-assets/taprpc"
1516
"github.com/lightninglabs/taproot-assets/taprpc/priceoraclerpc"
@@ -242,7 +243,7 @@ func (c *TapdClient) GetAssetPrice(ctx context.Context, assetID string,
242243
func getSatsFromAssetAmt(assetAmt uint64, assetRate *rfqrpc.FixedPoint) (
243244
btcutil.Amount, error) {
244245

245-
rateFP, err := rfqrpc.UnmarshalFixedPoint(assetRate)
246+
rateFP, err := rpcutils.UnmarshalRfqFixedPoint(assetRate)
246247
if err != nil {
247248
return 0, fmt.Errorf("cannot unmarshal asset rate: %w", err)
248249
}

client.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"github.com/lightninglabs/loop/sweep"
2121
"github.com/lightninglabs/loop/sweepbatcher"
2222
"github.com/lightninglabs/loop/utils"
23-
"github.com/lightninglabs/taproot-assets/taprpc/rfqrpc"
23+
"github.com/lightninglabs/taproot-assets/rpcutils"
2424
"github.com/lightningnetwork/lnd/lntypes"
2525
"github.com/lightningnetwork/lnd/routing/route"
2626
"google.golang.org/grpc"
@@ -982,7 +982,7 @@ func (s *Client) getAssetRfq(ctx context.Context, quote *LoopOutQuote,
982982
return nil, err
983983
}
984984

985-
prepayAssetRate, err := rfqrpc.UnmarshalFixedPoint(
985+
prepayAssetRate, err := rpcutils.UnmarshalRfqFixedPoint(
986986
prepayRfq.BidAssetRate,
987987
)
988988
if err != nil {
@@ -1003,7 +1003,7 @@ func (s *Client) getAssetRfq(ctx context.Context, quote *LoopOutQuote,
10031003
return nil, err
10041004
}
10051005

1006-
swapAssetRate, err := rfqrpc.UnmarshalFixedPoint(
1006+
swapAssetRate, err := rpcutils.UnmarshalRfqFixedPoint(
10071007
swapRfq.BidAssetRate,
10081008
)
10091009
if err != nil {

cmd/loop/quote.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"github.com/lightninglabs/loop"
1111
"github.com/lightninglabs/loop/looprpc"
1212
"github.com/lightninglabs/taproot-assets/rfqmath"
13+
"github.com/lightninglabs/taproot-assets/rpcutils"
1314
"github.com/lightninglabs/taproot-assets/taprpc/rfqrpc"
1415
"github.com/lightningnetwork/lnd/lnwire"
1516
"github.com/lightningnetwork/lnd/routing/route"
@@ -355,5 +356,5 @@ func unmarshalFixedPoint(fp *looprpc.FixedPoint) (*rfqmath.BigIntFixedPoint,
355356
Scale: fp.Scale,
356357
}
357358

358-
return rfqrpc.UnmarshalFixedPoint(rfqrpcFP)
359+
return rpcutils.UnmarshalRfqFixedPoint(rfqrpcFP)
359360
}

go.mod

+17-12
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0
1414
github.com/fortytw2/leaktest v1.3.0
1515
github.com/golang-migrate/migrate/v4 v4.17.0
16-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0
16+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0
1717
github.com/jackc/pgconn v1.14.3
1818
github.com/jackc/pgerrcode v0.0.0-20240316143900-6e2875d9b438
1919
github.com/jessevdk/go-flags v1.4.0
@@ -22,7 +22,8 @@ require (
2222
github.com/lightninglabs/lndclient v0.19.0-4
2323
github.com/lightninglabs/loop/looprpc v1.0.0
2424
github.com/lightninglabs/loop/swapserverrpc v1.0.13
25-
github.com/lightninglabs/taproot-assets v0.5.2-0.20250424162728-b6000498210d
25+
github.com/lightninglabs/taproot-assets v0.5.2-0.20250502070549-52257227c8f8
26+
github.com/lightninglabs/taproot-assets/taprpc v1.0.1
2627
github.com/lightningnetwork/lnd v0.19.0-beta.rc2.0.20250423092132-a35ace7371af
2728
github.com/lightningnetwork/lnd/cert v1.2.2
2829
github.com/lightningnetwork/lnd/clock v1.1.1
@@ -47,7 +48,7 @@ require github.com/btcsuite/btclog/v2 v2.0.1-0.20250110154127-3ae4bf1cb318
4748
require (
4849
dario.cat/mergo v1.0.1 // indirect
4950
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
50-
github.com/Microsoft/go-winio v0.6.1 // indirect
51+
github.com/Microsoft/go-winio v0.6.2 // indirect
5152
github.com/NebulousLabs/fastrand v0.0.0-20181203155948-6fb6489aac4e // indirect
5253
github.com/NebulousLabs/go-upnp v0.0.0-20180202185039-29b680b06c82 // indirect
5354
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
@@ -74,7 +75,7 @@ require (
7475
github.com/decred/dcrd/lru v1.1.2 // indirect
7576
github.com/docker/cli v28.0.1+incompatible // indirect
7677
github.com/docker/docker v28.0.1+incompatible // indirect
77-
github.com/docker/go-connections v0.4.0 // indirect
78+
github.com/docker/go-connections v0.5.0 // indirect
7879
github.com/docker/go-units v0.5.0 // indirect
7980
github.com/dustin/go-humanize v1.0.1 // indirect
8081
github.com/fergusstrange/embedded-postgres v1.25.0 // indirect
@@ -138,7 +139,7 @@ require (
138139
github.com/modern-go/reflect2 v1.0.2 // indirect
139140
github.com/ncruces/go-strftime v0.1.9 // indirect
140141
github.com/opencontainers/go-digest v1.0.0 // indirect
141-
github.com/opencontainers/image-spec v1.0.2 // indirect
142+
github.com/opencontainers/image-spec v1.1.0 // indirect
142143
github.com/opencontainers/runc v1.2.0 // indirect
143144
github.com/pkg/errors v0.9.1 // indirect
144145
github.com/pmezard/go-difflib v1.0.0 // indirect
@@ -170,27 +171,27 @@ require (
170171
go.etcd.io/etcd/raft/v3 v3.5.12 // indirect
171172
go.etcd.io/etcd/server/v3 v3.5.12 // indirect
172173
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
173-
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect
174+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
174175
go.opentelemetry.io/otel v1.35.0 // indirect
175-
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 // indirect
176+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 // indirect
176177
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 // indirect
177178
go.opentelemetry.io/otel/metric v1.35.0 // indirect
178179
go.opentelemetry.io/otel/sdk v1.35.0 // indirect
179180
go.opentelemetry.io/otel/trace v1.35.0 // indirect
180-
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
181+
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
181182
go.uber.org/atomic v1.10.0 // indirect
182183
go.uber.org/multierr v1.6.0 // indirect
183184
go.uber.org/zap v1.23.0 // indirect
184185
golang.org/x/crypto v0.36.0 // indirect
185186
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 // indirect
186-
golang.org/x/mod v0.17.0 // indirect
187+
golang.org/x/mod v0.21.0 // indirect
187188
golang.org/x/sync v0.12.0 // indirect
188189
golang.org/x/sys v0.31.0 // indirect
189190
golang.org/x/term v0.30.0 // indirect
190191
golang.org/x/text v0.23.0 // indirect
191-
golang.org/x/time v0.3.0 // indirect
192-
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
193-
google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect
192+
golang.org/x/time v0.5.0 // indirect
193+
golang.org/x/tools v0.24.0 // indirect
194+
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect
194195
google.golang.org/genproto/googleapis/api v0.0.0-20240730163845-b1a4ccb954bf // indirect
195196
google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf // indirect
196197
gopkg.in/errgo.v1 v1.0.1 // indirect
@@ -208,6 +209,10 @@ require (
208209
// allows us to specify that as an option.
209210
replace google.golang.org/protobuf => github.com/lightninglabs/protobuf-go-hex-display v1.34.2-hex-display
210211

212+
// We are using a fork of the migration library with custom functionality that
213+
// did not yet make it into the upstream repository.
214+
replace github.com/golang-migrate/migrate/v4 => github.com/lightninglabs/migrate/v4 v4.18.2-9023d66a-fork-pr-2
215+
211216
replace github.com/lightninglabs/loop/swapserverrpc => ./swapserverrpc
212217

213218
replace github.com/lightninglabs/loop/looprpc => ./looprpc

0 commit comments

Comments
 (0)