Skip to content

Commit daf1aef

Browse files
committed
Merge branch 'bopen-master' into updates/fix-skipped-tests
2 parents 789fbf6 + 9dd0a0e commit daf1aef

File tree

143 files changed

+5120
-1384
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+5120
-1384
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@ golangci-lint-report.xml
4040

4141
# Ignore any other files or directories specific to your project
4242

43+
# Ignore files related to AI tools
44+
CLAUDE.md

.vscode/settings.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,25 @@
22
"sonarlint.connectedMode.project": {
33
"connectionId": "bitcoin-sv",
44
"projectKey": "bitcoin-sv_go-sdk"
5-
}
5+
},
6+
"workbench.colorCustomizations": {
7+
"activityBar.activeBackground": "#e7a213",
8+
"activityBar.background": "#e7a213",
9+
"activityBar.foreground": "#15202b",
10+
"activityBar.inactiveForeground": "#15202b99",
11+
"activityBarBadge.background": "#e2fdf4",
12+
"activityBarBadge.foreground": "#15202b",
13+
"commandCenter.border": "#15202b99",
14+
"sash.hoverBorder": "#e7a213",
15+
"statusBar.background": "#b8810f",
16+
"statusBar.foreground": "#15202b",
17+
"statusBarItem.hoverBackground": "#89600b",
18+
"statusBarItem.remoteBackground": "#b8810f",
19+
"statusBarItem.remoteForeground": "#15202b",
20+
"titleBar.activeBackground": "#b8810f",
21+
"titleBar.activeForeground": "#15202b",
22+
"titleBar.inactiveBackground": "#b8810f99",
23+
"titleBar.inactiveForeground": "#15202b99"
24+
},
25+
"peacock.color": "#b8810f"
626
}

auth/clients/authhttp/authhttp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ func (a *AuthFetch) handlePaymentAndRetry(ctx context.Context, urlStr string, co
759759
Outputs: []wallet.CreateActionOutput{
760760
{
761761
Satoshis: satoshisRequired,
762-
LockingScript: fmt.Sprintf("P2PKH:%s", derivedKey.PublicKey.ToDERHex()),
762+
LockingScript: derivedKey.PublicKey.ToDER(),
763763
CustomInstructions: fmt.Sprintf(`{"derivationPrefix":"%s","derivationSuffix":"%s","payee":"%s"}`,
764764
derivationPrefix, derivationSuffix, serverIdentityKey),
765765
OutputDescription: "HTTP request payment",

auth/clients/authhttp/authhttp_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func TestNew(t *testing.T) {
5353
mockWallet := wallet.NewMockWallet(t)
5454
mockSessionManager := NewMockSessionManager()
5555
requestedCerts := &utils.RequestedCertificateSet{
56-
Certifiers: []string{},
56+
Certifiers: []wallet.HexBytes33{},
5757
CertificateTypes: make(utils.RequestedCertificateTypeIDAndFieldList),
5858
}
5959

@@ -74,7 +74,7 @@ func TestNewWithNilSessionManager(t *testing.T) {
7474
// Set up dependencies
7575
mockWallet := wallet.NewMockWallet(t)
7676
requestedCerts := &utils.RequestedCertificateSet{
77-
Certifiers: []string{},
77+
Certifiers: []wallet.HexBytes33{},
7878
CertificateTypes: make(utils.RequestedCertificateTypeIDAndFieldList),
7979
}
8080

auth/peer.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,22 @@ const AUTH_PROTOCOL_ID = "authrite message signature"
2626
// AUTH_VERSION is the version of the auth protocol
2727
const AUTH_VERSION = "0.1"
2828

29+
// OnGeneralMessageReceivedCallback is called when a general message is received from a peer.
30+
// The callback receives the sender's public key and the message payload.
2931
type OnGeneralMessageReceivedCallback func(senderPublicKey *ec.PublicKey, payload []byte) error
32+
33+
// OnCertificateReceivedCallback is called when certificates are received from a peer.
34+
// The callback receives the sender's public key and the list of certificates.
3035
type OnCertificateReceivedCallback func(senderPublicKey *ec.PublicKey, certs []*certificates.VerifiableCertificate) error
36+
37+
// OnCertificateRequestReceivedCallback is called when a certificate request is received from a peer.
38+
// The callback receives the sender's public key and the requested certificate set.
3139
type OnCertificateRequestReceivedCallback func(senderPublicKey *ec.PublicKey, requestedCertificates utils.RequestedCertificateSet) error
3240

41+
// Peer represents a peer capable of performing mutual authentication.
42+
// It manages sessions, handles authentication handshakes, certificate requests and responses,
43+
// and sending and receiving general messages over a transport layer.
44+
// This implementation supports multiple concurrent sessions per peer identity key.
3345
type Peer struct {
3446
sessionManager SessionManager
3547
transport Transport
@@ -48,6 +60,7 @@ type Peer struct {
4860
logger *log.Logger // Logger for debug messages
4961
}
5062

63+
// PeerOptions contains configuration options for creating a new Peer instance.
5164
type PeerOptions struct {
5265
Wallet wallet.Interface
5366
Transport Transport
@@ -90,7 +103,7 @@ func NewPeer(cfg *PeerOptions) *Peer {
90103
peer.CertificatesToRequest = cfg.CertificatesToRequest
91104
} else {
92105
peer.CertificatesToRequest = &utils.RequestedCertificateSet{
93-
Certifiers: []string{},
106+
Certifiers: []wallet.HexBytes33{},
94107
CertificateTypes: make(utils.RequestedCertificateTypeIDAndFieldList),
95108
}
96109
}

0 commit comments

Comments
 (0)