ceremonyclient/node/crypto/wesolowski_frame_prover_test.go
Cassandra Heart 0cd6b41f5d
v1.2.4 (#43)
2024-02-13 01:04:56 -06:00

29 lines
758 B
Go

package crypto_test
import (
"bytes"
"testing"
"time"
"github.com/stretchr/testify/assert"
"go.uber.org/zap"
"source.quilibrium.com/quilibrium/monorepo/node/crypto"
)
func TestMasterProve(t *testing.T) {
l, _ := zap.NewProduction()
w := crypto.NewWesolowskiFrameProver(l)
m, err := w.CreateMasterGenesisFrame([]byte{
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
}, bytes.Repeat([]byte{0x00}, 516), 10000)
assert.NoError(t, err)
next, err := w.ProveMasterClockFrame(m, time.Now().UnixMilli(), 10000)
assert.NoError(t, err)
err = w.VerifyMasterClockFrame(next)
assert.NoError(t, err)
}