mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-03-26 17:52:20 +01:00
21 lines
476 B
Go
21 lines
476 B
Go
package libsecp256k1
|
|
|
|
import (
|
|
"encoding/json"
|
|
"testing"
|
|
|
|
"github.com/nbd-wtf/go-nostr"
|
|
"github.com/nbd-wtf/go-nostr/test_common"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestEventVerification(t *testing.T) {
|
|
for _, jevt := range test_common.NormalEvents {
|
|
evt := &nostr.Event{}
|
|
json.Unmarshal([]byte(jevt), evt)
|
|
ok, _ := CheckSignature(evt)
|
|
shouldBe, _ := evt.CheckSignature()
|
|
assert.Equal(t, ok, shouldBe, "%s signature must be %s", jevt, shouldBe)
|
|
}
|
|
}
|