Refactor signer implementation to use p8k package
- Replaced all instances of p256k1signer with the new p8k.Signer across various modules, including event creation, policy handling, and database interactions. - Updated related test cases and benchmarks to ensure compatibility with the new signer interface. - Bumped version to v0.25.0 to reflect these significant changes and improvements in cryptographic operations.
This commit is contained in:
@@ -16,12 +16,12 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
"golang.org/x/net/websocket"
|
||||
"lol.mleku.dev/chk"
|
||||
p256k1signer "p256k1.mleku.dev/signer"
|
||||
"next.orly.dev/pkg/encoders/event"
|
||||
"next.orly.dev/pkg/encoders/filter"
|
||||
"next.orly.dev/pkg/encoders/hex"
|
||||
"next.orly.dev/pkg/encoders/kind"
|
||||
"next.orly.dev/pkg/encoders/tag"
|
||||
"next.orly.dev/pkg/interfaces/signer/p8k"
|
||||
"next.orly.dev/pkg/utils"
|
||||
"next.orly.dev/pkg/utils/normalize"
|
||||
)
|
||||
@@ -36,7 +36,7 @@ func TestPublish(t *testing.T) {
|
||||
Tags: tag.NewS(tag.NewFromAny("foo", "bar")),
|
||||
Pubkey: pub,
|
||||
}
|
||||
sign := p256k1signer.NewP256K1Signer()
|
||||
sign := p8k.MustNew()
|
||||
var err error
|
||||
if err = sign.InitSec(priv); chk.E(err) {
|
||||
}
|
||||
@@ -208,7 +208,7 @@ var anyOriginHandshake = func(conf *websocket.Config, r *http.Request) error {
|
||||
|
||||
func makeKeyPair(t *testing.T) (sec, pub []byte) {
|
||||
t.Helper()
|
||||
sign := p256k1signer.NewP256K1Signer()
|
||||
sign := p8k.MustNew()
|
||||
var err error
|
||||
if err = sign.Generate(); chk.E(err) {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user