Colocate the Hex method with the receiver

pull/784/head
Eugene Kim 6 years ago
parent 1bd5a8d606
commit 5c74aa5899
  1. 10
      core/types/shard_state.go

@ -21,6 +21,11 @@ type ShardState []Committee
// BlsPublicKey defines the bls public key
type BlsPublicKey [96]byte
// Hex returns the hex string of bls public key
func (pk BlsPublicKey) Hex() string {
return hex.EncodeToString(pk[:])
}
// NodeID represents node id (BLS address).
type NodeID struct {
EcdsaAddress string
@ -34,11 +39,6 @@ type Committee struct {
NodeList []NodeID
}
// Hex returns the hex string of bls public key
func (pk BlsPublicKey) Hex() string {
return hex.EncodeToString(pk[:])
}
// GetHashFromNodeList will sort the list, then use Keccak256 to hash the list
// notice that the input nodeList will be modified (sorted)
func GetHashFromNodeList(nodeList []NodeID) []byte {

Loading…
Cancel
Save