add last touches to the PR

This commit is contained in:
Jonathan Gimeno 2020-02-28 19:06:03 +01:00
parent 2b688a0121
commit f8442bb46f
1 changed files with 2 additions and 1 deletions

View File

@ -265,6 +265,7 @@ func incrementAllSequenceNumbers(initSeqNums []uint64) {
}
}
// CreateTestPubKeys generates crypto.PubKeys in ascending order.
func CreateTestPubKeys(numPubKeys int) []crypto.PubKey {
var publicKeys []crypto.PubKey
var buffer bytes.Buffer
@ -281,12 +282,12 @@ func CreateTestPubKeys(numPubKeys int) []crypto.PubKey {
return publicKeys
}
// NewPubKeyFromHex returns a PubKey from a hex string.
func NewPubKeyFromHex(pk string) (res crypto.PubKey) {
pkBytes, err := hex.DecodeString(pk)
if err != nil {
panic(err)
}
//res, err = crypto.PubKeyFromBytes(pkBytes)
var pkEd ed25519.PubKeyEd25519
copy(pkEd[:], pkBytes)
return pkEd