mirror of
https://github.com/logos-messaging/go-rln.git
synced 2026-01-02 13:03:07 +00:00
startef
This commit is contained in:
parent
0363fb0053
commit
aa22c4ca2d
@ -8,7 +8,7 @@ import (
|
||||
"github.com/decanus/go-rln/rln"
|
||||
)
|
||||
|
||||
func TestNew(t *testing.T) {
|
||||
func TestRLN_New(t *testing.T) {
|
||||
params, err := ioutil.ReadFile("./testdata/parameters.key")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@ -20,7 +20,7 @@ func TestNew(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestGenerateKey(t *testing.T) {
|
||||
func TestRLN_GenerateKey(t *testing.T) {
|
||||
params, err := ioutil.ReadFile("./testdata/parameters.key")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@ -44,3 +44,28 @@ func TestGenerateKey(t *testing.T) {
|
||||
t.Fatal("k.Commitment was empty")
|
||||
}
|
||||
}
|
||||
|
||||
func TestRLN_Verify(t *testing.T) {
|
||||
// This test is based on a similar test in nim-waku:
|
||||
// https://github.com/status-im/nim-waku/blob/b7998de09d1ef04599a699938da69aecfa63cc6f/tests/v2/test_waku_rln_relay.nim#L559
|
||||
// as well as tests in the rust repository:
|
||||
// https://github.com/kilic/rln/blob/master/src/ffi.rs#L158
|
||||
|
||||
params, err := ioutil.ReadFile("./testdata/parameters.key")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
r, err := rln.New(32, params)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
_, err = r.GenerateKey()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// @TODO create inputs
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user