Skip to content

Commit

Permalink
add logs to debug in CircleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
torao committed Jul 16, 2020
1 parent 2d3e049 commit 642e48c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crypto/bls/bls.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@ import (
"bytes"
"crypto/subtle"
"fmt"
"os"

"github.com/herumi/bls-eth-go-binary/bls"
amino "github.com/tendermint/go-amino"

"github.com/tendermint/tendermint/libs/log"

"github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/crypto/tmhash"
)

var _ crypto.PrivKey = PrivKeyBLS12{}

// TODO to investigate CI env error
var logger = log.NewTMLogger(log.NewSyncWriter(os.Stdout)).With("module", "bls")

const (
PrivKeyAminoName = "tendermint/PrivKeyBLS12"
PubKeyAminoName = "tendermint/PubKeyBLS12"
Expand Down Expand Up @@ -41,6 +47,8 @@ func init() {
if err != nil {
panic(fmt.Sprintf("ERROR: %s", err))
}

logger.Info("BLS: init() complete")
}

// PrivKeyBLS12 implements crypto.PrivKey.
Expand All @@ -62,11 +70,15 @@ func (privKey PrivKeyBLS12) Bytes() []byte {

// Sign produces a signature on the provided message.
func (privKey PrivKeyBLS12) Sign(msg []byte) ([]byte, error) {
if msg == nil {
panic(fmt.Sprintf("Nil specified as the message"))
}
blsKey := bls.SecretKey{}
err := blsKey.Deserialize(privKey[:])
if err != nil {
panic(fmt.Sprintf("Failed to copy the private key: %s", err))
}
logger.Info(fmt.Sprintf("BLS: Sign(%v)", msg))
sign := blsKey.SignByte(msg)
return sign.Serialize(), nil
}
Expand Down

0 comments on commit 642e48c

Please sign in to comment.