Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
go fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Mira Belenkiy committed Oct 19, 2023
1 parent 1f83269 commit ff0441f
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 111 deletions.
5 changes: 2 additions & 3 deletions ecdsa/accsigning/messages.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) 2023, Circle Internet Financial, LTD.
// All rights reserved
//
// Copyright (c) 2023, Circle Internet Financial, LTD.
// All rights reserved
package accsigning

import (
Expand Down
5 changes: 3 additions & 2 deletions ecdsa/accsigning/round_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ package accsigning

import (
"fmt"
// "sync"
// "sync"
"testing"

"github.com/stretchr/testify/assert"

"github.com/bnb-chain/tss-lib/common"
"github.com/bnb-chain/tss-lib/ecdsa/keygen"
// "github.com/bnb-chain/tss-lib/tss"
// "github.com/bnb-chain/tss-lib/tss"
)

/*
* Uncomment test to check individual round
*
Expand Down
5 changes: 2 additions & 3 deletions ecdsa/cggplus/messages.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) 2023, Circle Internet Financial, LTD.
// All rights reserved
//
// Copyright (c) 2023, Circle Internet Financial, LTD.
// All rights reserved
package cggplus

import (
Expand Down
207 changes: 104 additions & 103 deletions ecdsa/cggplus/round_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,129 +5,130 @@
package cggplus

import (
// "github.com/bnb-chain/tss-lib/tss"
// "sync"
// "github.com/bnb-chain/tss-lib/tss"
// "sync"
"testing"
)

/*
* Uncomment test to check individual round
*
func TestRound1(t *testing.T) {
params, parties, outCh, _, _, _ := SetupParties(t)
rounds := RunRound1(t, params, parties, outCh)
wg := sync.WaitGroup{}
partyCount := len(parties)
errChs := make(chan *tss.Error, partyCount*partyCount*3)
for _, round := range rounds {
wg.Add(1)
go func(round *round1) {
defer wg.Done()
nextRound := &round2{round}
nextRound.VerifyRound1Messages(errChs)
}(round)
func TestRound1(t *testing.T) {
params, parties, outCh, _, _, _ := SetupParties(t)
rounds := RunRound1(t, params, parties, outCh)
wg := sync.WaitGroup{}
partyCount := len(parties)
errChs := make(chan *tss.Error, partyCount*partyCount*3)
for _, round := range rounds {
wg.Add(1)
go func(round *round1) {
defer wg.Done()
nextRound := &round2{round}
nextRound.VerifyRound1Messages(errChs)
}(round)
}
wg.Wait()
close(errChs)
AssertNoErrors(t, errChs)
}
wg.Wait()
close(errChs)
AssertNoErrors(t, errChs)
}
func TestRound2(t *testing.T) {
params, parties, outCh, _, _, _ := SetupParties(t)
t.Logf("round 1")
round1s := RunRound1(t, params, parties, outCh)
t.Logf("round 2")
totalMessages := len(parties) * len(parties)
round2s := RunRound[*round1, *round2](t, params, parties, round1s, totalMessages, outCh)
func TestRound2(t *testing.T) {
params, parties, outCh, _, _, _ := SetupParties(t)
t.Logf("round 1")
round1s := RunRound1(t, params, parties, outCh)
t.Logf("round 2")
totalMessages := len(parties) * len(parties)
round2s := RunRound[*round1, *round2](t, params, parties, round1s, totalMessages, outCh)
wg := sync.WaitGroup{}
partyCount := len(parties)
errChs := make(chan *tss.Error, partyCount*partyCount*partyCount)
for _, round := range round2s {
wg.Add(1)
go func(round *round2) {
defer wg.Done()
nextRound := &round3{round}
nextRound.VerifyRound2Messages(errChs)
}(round)
wg := sync.WaitGroup{}
partyCount := len(parties)
errChs := make(chan *tss.Error, partyCount*partyCount*partyCount)
for _, round := range round2s {
wg.Add(1)
go func(round *round2) {
defer wg.Done()
nextRound := &round3{round}
nextRound.VerifyRound2Messages(errChs)
}(round)
}
wg.Wait()
close(errChs)
AssertNoErrors(t, errChs)
}
wg.Wait()
close(errChs)
AssertNoErrors(t, errChs)
}
func TestRound3(t *testing.T) {
params, parties, outCh, _, _, _ := SetupParties(t)
t.Logf("round 1")
round1s := RunRound1(t, params, parties, outCh)
t.Logf("round 2")
totalMessages := len(parties) * len(parties)
round2s := RunRound[*round1, *round2](t, params, parties, round1s, totalMessages, outCh)
t.Logf("round 3")
round3s := RunRound[*round2, *round3](t, params, parties, round2s, len(parties), outCh)
func TestRound3(t *testing.T) {
params, parties, outCh, _, _, _ := SetupParties(t)
t.Logf("round 1")
round1s := RunRound1(t, params, parties, outCh)
t.Logf("round 2")
totalMessages := len(parties) * len(parties)
round2s := RunRound[*round1, *round2](t, params, parties, round1s, totalMessages, outCh)
t.Logf("round 3")
round3s := RunRound[*round2, *round3](t, params, parties, round2s, len(parties), outCh)
wg := sync.WaitGroup{}
partyCount := len(parties)
errChs := make(chan *tss.Error, partyCount*partyCount*partyCount)
for _, round := range round3s {
wg.Add(1)
go func(round *round3) {
defer wg.Done()
nextRound := &round4{round}
nextRound.VerifyRound3Messages(errChs)
}(round)
wg := sync.WaitGroup{}
partyCount := len(parties)
errChs := make(chan *tss.Error, partyCount*partyCount*partyCount)
for _, round := range round3s {
wg.Add(1)
go func(round *round3) {
defer wg.Done()
nextRound := &round4{round}
nextRound.VerifyRound3Messages(errChs)
}(round)
}
wg.Wait()
close(errChs)
AssertNoErrors(t, errChs)
}
wg.Wait()
close(errChs)
AssertNoErrors(t, errChs)
}
func TestRound4(t *testing.T) {
params, parties, outCh, _, _, _ := SetupParties(t)
t.Logf("round 1")
round1s := RunRound1(t, params, parties, outCh)
t.Logf("round 2")
totalMessages := len(parties) * len(parties)
round2s := RunRound[*round1, *round2](t, params, parties, round1s, totalMessages, outCh)
t.Logf("round 3")
round3s := RunRound[*round2, *round3](t, params, parties, round2s, len(parties), outCh)
t.Logf("round 4")
_ = RunRound[*round3, *round4](t, params, parties, round3s, len(parties), outCh)
func TestRound4(t *testing.T) {
params, parties, outCh, _, _, _ := SetupParties(t)
t.Logf("round 1")
round1s := RunRound1(t, params, parties, outCh)
t.Logf("round 2")
totalMessages := len(parties) * len(parties)
round2s := RunRound[*round1, *round2](t, params, parties, round1s, totalMessages, outCh)
t.Logf("round 3")
round3s := RunRound[*round2, *round3](t, params, parties, round2s, len(parties), outCh)
t.Logf("round 4")
_ = RunRound[*round3, *round4](t, params, parties, round3s, len(parties), outCh)
// skip verification; round 4 does not output messages
}
// skip verification; round 4 does not output messages
}
func TestRound5(t *testing.T) {
params, parties, outCh, _, _, _ := SetupParties(t)
func TestRound5(t *testing.T) {
params, parties, outCh, _, _, _ := SetupParties(t)
t.Logf("round 1")
round1s := RunRound1(t, params, parties, outCh)
t.Logf("round 2")
totalMessages := len(parties) * len(parties)
round2s := RunRound[*round1, *round2](t, params, parties, round1s, totalMessages, outCh)
t.Logf("round 3")
round3s := RunRound[*round2, *round3](t, params, parties, round2s, len(parties), outCh)
t.Logf("round 4")
round4s := RunRound[*round3, *round4](t, params, parties, round3s, len(parties), outCh)
t.Logf("round 5")
round5s := RunRound[*round4, *round5](t, params, parties, round4s, len(parties), outCh)
t.Logf("round 1")
round1s := RunRound1(t, params, parties, outCh)
t.Logf("round 2")
totalMessages := len(parties) * len(parties)
round2s := RunRound[*round1, *round2](t, params, parties, round1s, totalMessages, outCh)
t.Logf("round 3")
round3s := RunRound[*round2, *round3](t, params, parties, round2s, len(parties), outCh)
t.Logf("round 4")
round4s := RunRound[*round3, *round4](t, params, parties, round3s, len(parties), outCh)
t.Logf("round 5")
round5s := RunRound[*round4, *round5](t, params, parties, round4s, len(parties), outCh)
wg := sync.WaitGroup{}
partyCount := len(parties)
errChs := make(chan *tss.Error, partyCount*partyCount*partyCount)
for _, round := range round5s {
wg.Add(1)
go func(round *round5) {
defer wg.Done()
nextRound := &finalization{round}
nextRound.VerifyRound5Messages(errChs)
}(round)
wg := sync.WaitGroup{}
partyCount := len(parties)
errChs := make(chan *tss.Error, partyCount*partyCount*partyCount)
for _, round := range round5s {
wg.Add(1)
go func(round *round5) {
defer wg.Done()
nextRound := &finalization{round}
nextRound.VerifyRound5Messages(errChs)
}(round)
}
wg.Wait()
close(errChs)
AssertNoErrors(t, errChs)
}
wg.Wait()
close(errChs)
AssertNoErrors(t, errChs)
}
*/
func TestRoundFinalization(t *testing.T) {
params, parties, outCh, _, _, _ := SetupParties(t)
Expand Down

0 comments on commit ff0441f

Please sign in to comment.