mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
build: fix dependency security alerts
This commit is contained in:
parent
39c97e60d2
commit
338a6ef9f1
10 changed files with 118 additions and 1492 deletions
|
|
@ -5,13 +5,13 @@ import (
|
|||
"encoding/hex"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/btcsuite/btcd/btcutil"
|
||||
"github.com/lightninglabs/taproot-assets/rfqmath"
|
||||
"github.com/lightninglabs/taproot-assets/rpcutils"
|
||||
"github.com/lightninglabs/taproot-assets/tapcfg"
|
||||
"github.com/lightninglabs/taproot-assets/taprpc"
|
||||
"github.com/lightninglabs/taproot-assets/taprpc/priceoraclerpc"
|
||||
"github.com/lightninglabs/taproot-assets/taprpc/rfqrpc"
|
||||
|
|
@ -49,13 +49,16 @@ type TapdConfig struct {
|
|||
// DefaultTapdConfig returns a default configuration to connect to a taproot
|
||||
// assets daemon.
|
||||
func DefaultTapdConfig() *TapdConfig {
|
||||
defaultConf := tapcfg.DefaultConfig()
|
||||
defaultTapdDir := btcutil.AppDataDir("tapd", false)
|
||||
|
||||
return &TapdConfig{
|
||||
Activate: false,
|
||||
Host: "localhost:10029",
|
||||
MacaroonPath: defaultConf.RpcConf.MacaroonPath,
|
||||
TLSPath: defaultConf.RpcConf.TLSCertPath,
|
||||
RFQtimeout: defaultRfqTimeout,
|
||||
Activate: false,
|
||||
Host: "localhost:10029",
|
||||
MacaroonPath: filepath.Join(
|
||||
defaultTapdDir, "mainnet", "admin.macaroon",
|
||||
),
|
||||
TLSPath: filepath.Join(defaultTapdDir, "tls.cert"),
|
||||
RFQtimeout: defaultRfqTimeout,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package assets
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/btcsuite/btcd/btcutil"
|
||||
|
|
@ -9,6 +10,21 @@ import (
|
|||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// TestDefaultTapdConfig tests that the default tapd connection paths match
|
||||
// tapd's mainnet defaults.
|
||||
func TestDefaultTapdConfig(t *testing.T) {
|
||||
defaultTapdDir := btcutil.AppDataDir("tapd", false)
|
||||
config := DefaultTapdConfig()
|
||||
|
||||
require.Equal(
|
||||
t, filepath.Join(defaultTapdDir, "mainnet", "admin.macaroon"),
|
||||
config.MacaroonPath,
|
||||
)
|
||||
require.Equal(
|
||||
t, filepath.Join(defaultTapdDir, "tls.cert"), config.TLSPath,
|
||||
)
|
||||
}
|
||||
|
||||
func TestGetPaymentMaxAmount(t *testing.T) {
|
||||
tests := []struct {
|
||||
satAmount btcutil.Amount
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue