Skip to content

Commit 2792a8a

Browse files
committed
multi: bump btcd dependency to fix JSON parsing
1 parent 8655542 commit 2792a8a

File tree

11 files changed

+47
-54
lines changed

11 files changed

+47
-54
lines changed

channeldb/migration_01_to_11/migration_11_invoices_test.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package migration_01_to_11
22

33
import (
44
"bytes"
5-
"fmt"
65
"testing"
76
"time"
87

@@ -154,12 +153,7 @@ func signDigestCompact(hash []byte) ([]byte, error) {
154153
privKey, _ := btcec.PrivKeyFromBytes(testPrivKeyBytes)
155154

156155
// ecdsa.SignCompact returns a pubkey-recoverable signature
157-
sig, err := ecdsa.SignCompact(privKey, hash, isCompressedKey)
158-
if err != nil {
159-
return nil, fmt.Errorf("can't sign the hash: %w", err)
160-
}
161-
162-
return sig, nil
156+
return ecdsa.SignCompact(privKey, hash, isCompressedKey), nil
163157
}
164158

165159
// getPayReq creates a payment request for the given net.

go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ require (
55
github.com/Yawning/aez v0.0.0-20211027044916-e49e68abd344
66
github.com/andybalholm/brotli v1.0.4
77
github.com/btcsuite/btcd v0.24.2-beta.rc1.0.20240625142744-cc26860b4026
8-
github.com/btcsuite/btcd/btcec/v2 v2.3.3
8+
github.com/btcsuite/btcd/btcec/v2 v2.3.4
99
github.com/btcsuite/btcd/btcutil v1.1.5
1010
github.com/btcsuite/btcd/btcutil/psbt v1.1.8
1111
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0
@@ -204,6 +204,8 @@ replace github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2
204204
// allows us to specify that as an option.
205205
replace google.golang.org/protobuf => github.com/lightninglabs/protobuf-go-hex-display v1.30.0-hex-display
206206

207+
replace github.com/btcsuite/btcd => github.com/guggero/btcd v0.20.1-beta.0.20240902133835-ed879eac20ec
208+
207209
// If you change this please also update .github/pull_request_template.md,
208210
// docs/INSTALL.md and GO_IMAGE in lnrpc/gen_protos_docker.sh.
209211
go 1.22.6

go.sum

Lines changed: 34 additions & 17 deletions
Large diffs are not rendered by default.

invoices/test_utils.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"crypto/rand"
55
"encoding/binary"
66
"encoding/hex"
7-
"fmt"
87
"sync"
98
"testing"
109
"time"
@@ -69,13 +68,7 @@ var (
6968
testMessageSigner = zpay32.MessageSigner{
7069
SignCompact: func(msg []byte) ([]byte, error) {
7170
hash := chainhash.HashB(msg)
72-
sig, err := ecdsa.SignCompact(testPrivKey, hash, true)
73-
if err != nil {
74-
return nil, fmt.Errorf("can't sign the "+
75-
"message: %v", err)
76-
}
77-
78-
return sig, nil
71+
return ecdsa.SignCompact(testPrivKey, hash, true), nil
7972
},
8073
}
8174

invoices/test_utils_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,7 @@ var (
122122
testMessageSigner = zpay32.MessageSigner{
123123
SignCompact: func(msg []byte) ([]byte, error) {
124124
hash := chainhash.HashB(msg)
125-
sig, err := ecdsa.SignCompact(testPrivKey, hash, true)
126-
if err != nil {
127-
return nil, fmt.Errorf("can't sign the "+
128-
"message: %v", err)
129-
}
130-
return sig, nil
125+
return ecdsa.SignCompact(testPrivKey, hash, true), nil
131126
},
132127
}
133128

keychain/btcwallet.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ func (b *BtcWalletKeyRing) SignMessageCompact(keyLoc KeyLocator,
448448
} else {
449449
digest = chainhash.HashB(msg)
450450
}
451-
return ecdsa.SignCompact(privKey, digest, true)
451+
return ecdsa.SignCompact(privKey, digest, true), nil
452452
}
453453

454454
// SignMessageSchnorr uses the Schnorr signature algorithm to sign the given

keychain/signer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func (p *PrivKeyMessageSigner) SignMessageCompact(msg []byte,
8585
} else {
8686
digest = chainhash.HashB(msg)
8787
}
88-
return ecdsa.SignCompact(p.privKey, digest, true)
88+
return ecdsa.SignCompact(p.privKey, digest, true), nil
8989
}
9090

9191
var _ SingleKeyMessageSigner = (*PubKeyMessageSigner)(nil)

lnrpc/invoicesrpc/addinvoice.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ func AddInvoice(ctx context.Context, cfg *AddInvoiceConfig,
587587

588588
return ecdsa.SignCompact(
589589
ephemKey, chainhash.HashB(msg), true,
590-
)
590+
), nil
591591
},
592592
})
593593
if err != nil {

lnrpc/walletrpc/walletkit_server.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2647,10 +2647,7 @@ func (w *WalletKit) SignMessageWithAddr(_ context.Context,
26472647
"fetched from wallet database: %w", err)
26482648
}
26492649

2650-
sigBytes, err := ecdsa.SignCompact(privKey, digest, pubKey.Compressed())
2651-
if err != nil {
2652-
return nil, fmt.Errorf("failed to create signature: %w", err)
2653-
}
2650+
sigBytes := ecdsa.SignCompact(privKey, digest, pubKey.Compressed())
26542651

26552652
// Bitcoin signatures are base64 encoded (being compatible with
26562653
// bitcoin-core and btcd).

lntest/mock/secretkeyring.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func (s *SecretKeyRing) SignMessageCompact(_ keychain.KeyLocator,
6969
} else {
7070
digest = chainhash.HashB(msg)
7171
}
72-
return ecdsa.SignCompact(s.RootKey, digest, true)
72+
return ecdsa.SignCompact(s.RootKey, digest, true), nil
7373
}
7474

7575
// SignMessageSchnorr signs the passed message and ignores the KeyDescriptor.

0 commit comments

Comments
 (0)