Skip to content

Commit

Permalink
Merge branch 'master' into dkg-reencrypt
Browse files Browse the repository at this point in the history
  • Loading branch information
jbsv authored Jun 14, 2023
2 parents de0746c + 7f67b61 commit bada612
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 23 deletions.
36 changes: 18 additions & 18 deletions cli/node/memcoin/mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,27 @@
//
// Unix example:
//
// # Expect GOPATH to be correctly set to have memcoin available.
// go install
// # Expect GOPATH to be correctly set to have memcoin available.
// go install
//
// memcoin --config /tmp/node1 start --listen tcp://127.0.0.1:2001 &
// memcoin --config /tmp/node2 start --listen tcp://127.0.0.1:2002 &
// memcoin --config /tmp/node3 start --listen tcp://127.0.0.1:2003 &
// memcoin --config /tmp/node1 start --listen tcp://127.0.0.1:2001 &
// memcoin --config /tmp/node2 start --listen tcp://127.0.0.1:2002 &
// memcoin --config /tmp/node3 start --listen tcp://127.0.0.1:2003 &
//
// # Share the different certificates among the participants.
// memcoin --config /tmp/node2 minogrpc join --address //127.0.0.1:2001\
// $(memcoin --config /tmp/node1 minogrpc token)
// memcoin --config /tmp/node3 minogrpc join --address //127.0.0.1:2001\
// $(memcoin --config /tmp/node1 minogrpc token)
// # Share the different certificates among the participants.
// memcoin --config /tmp/node2 minogrpc join --address //127.0.0.1:2001\
// $(memcoin --config /tmp/node1 minogrpc token)
// memcoin --config /tmp/node3 minogrpc join --address //127.0.0.1:2001\
// $(memcoin --config /tmp/node1 minogrpc token)
//
// # Create a chain with two members.
// memcoin --config /tmp/node1 ordering setup\
// --member $(memcoin --config /tmp/node1 ordering export)\
// --member $(memcoin --config /tmp/node2 ordering export)
//
// # Add the third after the chain is set up.
// memcoin --config /tmp/node1 ordering roster add\
// --member $(memcoin --config /tmp/node3 ordering export)
// # Create a chain with two members.
// memcoin --config /tmp/node1 ordering setup\
// --member $(memcoin --config /tmp/node1 ordering export)\
// --member $(memcoin --config /tmp/node2 ordering export)
//
// # Add the third after the chain is set up.
// memcoin --config /tmp/node1 ordering roster add\
// --member $(memcoin --config /tmp/node3 ordering export)
package main

import (
Expand All @@ -45,6 +44,7 @@ func main() {
err := run(os.Args)
if err != nil {
fmt.Printf("%+v\n", err)
os.Exit(1)
}
}

Expand Down
4 changes: 0 additions & 4 deletions cli/node/memcoin/mod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ import (
"github.com/stretchr/testify/require"
)

func TestMemcoin_Main(t *testing.T) {
main()
}

// This test creates a chain with initially 3 nodes. It then adds node 4 and 5
// in two blocks. Node 4 does not share its certificate which means others won't
// be able to communicate, but the chain should proceed because of the
Expand Down
5 changes: 5 additions & 0 deletions crypto/bls/bls.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ func (pk PublicKey) MarshalText() ([]byte, error) {
return []byte(fmt.Sprintf("bls:%x", buffer)), nil
}

// GetPoint returns the kyber.Point.
func (pk PublicKey) GetPoint() kyber.Point {
return pk.point
}

// String implements fmt.String. It returns a string representation of the
// point.
func (pk PublicKey) String() string {
Expand Down
7 changes: 7 additions & 0 deletions crypto/bls/bls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ func TestPublicKey_MarshalText(t *testing.T) {
require.EqualError(t, err, fake.Err("couldn't marshal"))
}

func TestPublicKey_GetPoint(t *testing.T) {
point := suite.Point()
pk := NewPublicKeyFromPoint(point)

require.True(t, point.Equal(pk.GetPoint()))
}

func TestPublicKey_String(t *testing.T) {
signer := Generate()
str := signer.GetPublicKey().(PublicKey).String()
Expand Down
2 changes: 1 addition & 1 deletion dkg/pedersen/dkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (s *instance) start(ctx context.Context, start types.Start, deals channel.T
}

// create the DKG
t := s.startRes.threshold
t := start.GetThreshold()
d, err := pedersen.NewDistKeyGenerator(suite, s.privKey, start.GetPublicKeys(), t)
if err != nil {
return xerrors.Errorf("failed to create new DKG: %v", err)
Expand Down
1 change: 1 addition & 0 deletions dkg/pedersen/dkgcli/dkgcli.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func main() {
err := run(os.Args)
if err != nil {
fmt.Printf("%+v\n", err)
os.Exit(1)
}
}

Expand Down

0 comments on commit bada612

Please sign in to comment.