mirror of
https://github.com/QuilibriumNetwork/ceremonyclient.git
synced 2026-02-21 10:27:26 +08:00
* v2.1.0 [omit consensus and adjacent] - this commit will be amended with the full release after the file copy is complete * 2.1.0 main node rollup
46 lines
941 B
Go
46 lines
941 B
Go
package ferret_test
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
"time"
|
|
|
|
"source.quilibrium.com/quilibrium/monorepo/ferret"
|
|
)
|
|
|
|
func TestFerretAlice(t *testing.T) {
|
|
alice, err := ferret.NewFerretOT(1, "", 5555, 1, 100000000, make([]bool, 0), true)
|
|
if err != nil {
|
|
t.Errorf("Failed to create ALICE: %v", err)
|
|
return
|
|
}
|
|
|
|
fmt.Println("alice sendcot")
|
|
alice.SendCOT()
|
|
fmt.Println("alice sendrot")
|
|
alice.SendROT()
|
|
for i := range uint64(100) {
|
|
fmt.Printf("%x\n", alice.SenderGetBlockData(i%2 == 1, i))
|
|
}
|
|
t.FailNow()
|
|
}
|
|
|
|
func TestFerretBob(t *testing.T) {
|
|
time.Sleep(100 * time.Millisecond)
|
|
|
|
bob, err := ferret.NewFerretOT(2, "127.0.0.1", 5555, 1, 100000000, make([]bool, 100000000), true)
|
|
if err != nil {
|
|
t.Errorf("Failed to create BOB: %v", err)
|
|
return
|
|
}
|
|
|
|
fmt.Println("bob recvcot")
|
|
bob.RecvCOT()
|
|
fmt.Println("bob recvrot")
|
|
bob.RecvROT()
|
|
for i := range uint64(100) {
|
|
fmt.Printf("%x\n", bob.ReceiverGetBlockData(i))
|
|
}
|
|
t.FailNow()
|
|
}
|