Skip to content

Commit

Permalink
accept custom sign options for schnorr library.
Browse files Browse the repository at this point in the history
  • Loading branch information
fiatjaf committed Nov 9, 2023
1 parent c357e6b commit fda3bd2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions event.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (evt Event) CheckSignature() (bool, error) {
}

// Sign signs an event with a given privateKey.
func (evt *Event) Sign(privateKey string) error {
func (evt *Event) Sign(privateKey string, signOpts ...schnorr.SignOption) error {
s, err := hex.DecodeString(privateKey)
if err != nil {
return fmt.Errorf("Sign called with invalid private key '%s': %w", privateKey, err)
Expand All @@ -144,7 +144,7 @@ func (evt *Event) Sign(privateKey string) error {
evt.PubKey = hex.EncodeToString(pkBytes[1:])

h := sha256.Sum256(evt.Serialize())
sig, err := schnorr.Sign(sk, h[:])
sig, err := schnorr.Sign(sk, h[:], signOpts...)
if err != nil {
return err
}
Expand Down

0 comments on commit fda3bd2

Please sign in to comment.