From 1b047b4ee556793aa18d7e292d318448ce43acd2 Mon Sep 17 00:00:00 2001 From: programmer10110 Date: Fri, 21 Aug 2020 19:59:47 +0300 Subject: [PATCH] fix airgapped test --- airgapped/airgapped_test.go | 20 ++++++++++---------- airgapped/dkg.go | 2 -- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/airgapped/airgapped_test.go b/airgapped/airgapped_test.go index 6d9a9d3..e75def7 100644 --- a/airgapped/airgapped_test.go +++ b/airgapped/airgapped_test.go @@ -130,13 +130,13 @@ func TestAirgappedAllSteps(t *testing.T) { //}) // get commits - var getCommitsRequest responses.SignatureProposalParticipantStatusResponse + var getCommitsRequest responses.DKGProposalPubKeysParticipantResponse for _, n := range tr.nodes { pubKey, err := n.Machine.pubKey.MarshalBinary() if err != nil { t.Fatalf("%s: failed to marshal pubkey: %v", n.Participant, err) } - entry := &responses.SignatureProposalParticipantStatusEntry{ + entry := &responses.DKGProposalPubKeysParticipantEntry{ ParticipantId: n.ParticipantID, Addr: n.Participant, DkgPubKey: pubKey, @@ -164,8 +164,8 @@ func TestAirgappedAllSteps(t *testing.T) { for _, req := range n.commits { p := responses.DKGProposalCommitParticipantEntry{ ParticipantId: req.ParticipantId, - Title: fmt.Sprintf("Participant#%d", req.ParticipantId), - Commit: req.Commit, + Addr: fmt.Sprintf("Participant#%d", req.ParticipantId), + DkgCommit: req.Commit, } payload = append(payload, &p) } @@ -188,8 +188,8 @@ func TestAirgappedAllSteps(t *testing.T) { for _, req := range n.deals { p := responses.DKGProposalDealParticipantEntry{ ParticipantId: req.ParticipantId, - Title: fmt.Sprintf("Participant#%d", req.ParticipantId), - Deal: req.Deal, + Addr: fmt.Sprintf("Participant#%d", req.ParticipantId), + DkgDeal: req.Deal, } payload = append(payload, &p) } @@ -208,12 +208,12 @@ func TestAirgappedAllSteps(t *testing.T) { runStep(tr, func(n *Node, wg *sync.WaitGroup) { defer wg.Done() - var payload responses.DKGProposalResponsesParticipantResponse + var payload responses.DKGProposalResponseParticipantResponse for _, req := range n.responses { - p := responses.DKGProposalResponsesParticipantEntry{ + p := responses.DKGProposalResponseParticipantEntry{ ParticipantId: req.ParticipantId, - Title: fmt.Sprintf("Participant#%d", req.ParticipantId), - Responses: req.Response, + Addr: fmt.Sprintf("Participant#%d", req.ParticipantId), + DkgResponse: req.Response, } payload = append(payload, &p) } diff --git a/airgapped/dkg.go b/airgapped/dkg.go index 5279ac7..cd1ae07 100644 --- a/airgapped/dkg.go +++ b/airgapped/dkg.go @@ -12,7 +12,6 @@ import ( "go.dedis.ch/kyber/v3" "go.dedis.ch/kyber/v3/pairing/bn256" dkgPedersen "go.dedis.ch/kyber/v3/share/dkg/pedersen" - "log" ) func (am *AirgappedMachine) handleStateAwaitParticipantsConfirmations(o *client.Operation) error { @@ -72,7 +71,6 @@ func (am *AirgappedMachine) handleStateDkgCommitsAwaitConfirmations(o *client.Op dkgInstance, ok := am.dkgInstances[o.DKGIdentifier] if !ok { - log.Printf("dkg instance for dkg round %s does not exist, create new\n", o.DKGIdentifier) dkgInstance = dkg.Init(am.suite, am.pubKey, am.secKey) }